X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/333700b34cb944ab49d1c9243f7193d50d25ebd1..de93104a2513acc5a378496c6bf6ab7ed0d45d60:/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 ca37eb41..40f45f6f 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) {