X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/eb61c7e9637a2744b4ffa748317f2b72bd16a27d..9feffcf1e18f73cbf75265533a70c5e252ce0748:/project/static/js/button_scripts.js?ds=sidebyside diff --git a/project/static/js/button_scripts.js b/project/static/js/button_scripts.js index 647f841a..1032dcf8 100644 --- a/project/static/js/button_scripts.js +++ b/project/static/js/button_scripts.js @@ -42,11 +42,11 @@ function ScriptletCenter() output = start_tag + end_tag; } - if (text.length == 0) { - this.XMLEditorMoveCursorForward(context, params.tag.length + 2); - } - this.XMLEditorReplaceSelectedText(context, output); + + if (text.length == 0) { + this.XMLEditorMoveCursorForward(context, -params.tag.length-3); + } }.bind(this); this.scriptlets['lineregexp'] = function(context, params) {