X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/9aa850ad8fb519b03bb854f3b731af32e42c54fa..c62820ef529ff40e46d30aedff2ba870e8e18395:/modules/documentCanvas/canvas/documentElement.js?ds=sidebyside diff --git a/modules/documentCanvas/canvas/documentElement.js b/modules/documentCanvas/canvas/documentElement.js index 4c09b75..7dd1f7d 100644 --- a/modules/documentCanvas/canvas/documentElement.js +++ b/modules/documentCanvas/canvas/documentElement.js @@ -528,8 +528,9 @@ $.extend(DocumentTextElement.prototype, { prev.setText(prev.getText() + this.getText() + next.getText()); next.detach(); } else if (prev || next) { - var target = prev ? prev : next; - target.setText(target.getText() + this.getText()); + var target = prev ? prev : next, + newText = prev ? target.getText() + this.getText() : this.getText() + target.getText(); + target.setText(newText); } else { parent.after(this); }