X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/8f3efc2235f836dd2b624d569d97a7ae0dad77ff..eb45e596e503a841c210b9773de0ccdbb0d3c2eb:/src/editor/plugins/core/core.js 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}; + } } };