X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/97b4fb7216407c6623f0e1307bae4b98b0c64b75..739242f6208f3e58570194fb1000086bafd527ef:/modules/documentCanvas/canvas/documentElement.js diff --git a/modules/documentCanvas/canvas/documentElement.js b/modules/documentCanvas/canvas/documentElement.js index e76ba78..cfdac5d 100644 --- a/modules/documentCanvas/canvas/documentElement.js +++ b/modules/documentCanvas/canvas/documentElement.js @@ -479,6 +479,10 @@ $.extend(DocumentTextElement.prototype, { idx = grandParent.childIndex(parent), prev = idx - 1 > -1 ? grandParentChildren[idx-1] : null, next = idx + 1 < grandParentChildren.length ? grandParentChildren[idx+1] : null; + + prev = (prev instanceof DocumentTextElement) ? prev : null; + next = (next instanceof DocumentTextElement) ? next : null; + if(prev && next) { prev.setText(prev.getText() + this.getText() + next.getText()); next.detach();