html:

[html]

[/html]

Angularjs:


[js]

  editComment(comment){
    var self = this;
    var editor = angular.element($(`#${comment._id}`));
    editor.markdown({autofocus: true, savable: true, hideable:true,
        onSave: function(e) {//e: markdown editor
          self.Blog.saveComment({
            id: self.blog._id,
            comment_id: comment._id,
            content: e.getContent()
          }).$promise
          .then(() => {
            //angular.element($('.md-editor')).children('.md-footer').html('Comment is updated.');
            var el = angular.element($('.md-editor')).parents('.panel');
            el.css( "background-color", "#ffeeff" );
            setTimeout(() => {
              el.css( "background-color", "#ffffff" );
            }, 2000);
            e.blur();
          })
          .catch(err => {
            self.errors.other = err;
          });
        }
    });
  }
[/js]

Leave a Reply