Skip to content

Commit

Permalink
fix append block on empty editor
Browse files Browse the repository at this point in the history
  • Loading branch information
salkar committed Jun 2, 2014
1 parent aba7c6f commit 97c6790
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion morrigan-jquery-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,13 @@ $.widget( "morrigan.morrigan_editor", {
Block: function (editor, topNode, data) {
this.editor = editor;
this.element = this._formSelf(data);
this.element.insertBefore(topNode);
if (topNode === undefined) {
var node = $('<p><br /></p>');
node.appendTo(editor._content);
this.element.insertBefore(node);
} else {
this.element.insertBefore(topNode);
}
},

_blockMethodsInitialize: function (editor) {
Expand Down

0 comments on commit 97c6790

Please sign in to comment.