X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/97b2b3365d24475cbf61b3ad82c879911270f279..d221e72024aa5d6f90e256728fa70f622d4e57d7:/src/editor/plugins/core/core.js?ds=sidebyside diff --git a/src/editor/plugins/core/core.js b/src/editor/plugins/core/core.js index 718a985..d11bf73 100644 --- a/src/editor/plugins/core/core.js +++ b/src/editor/plugins/core/core.js @@ -23,6 +23,18 @@ plugin.documentExtension.textNode.transformations = { getChangeRoot: function() { return this.context.parent().parent(); } + }, + mergeContentUp: function() { + var myPrev = this.prev(), + ret; + + if(myPrev) { + ret = myPrev.append(this); + return {node: ret, offset: ret.sameNode(this) ? null : ret.getText().length - this.getText().length}; + } else { + var range = this.parent().unwrapContent(); + return {node: range.element1, offset: 0}; + } } };