X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/d7ef322bd562485405be95d8812d4ad79ac458fb..519e5664528bc9dd8cc7ff034fb9c2148a6db063:/redakcja/static/js/button_scripts.js diff --git a/redakcja/static/js/button_scripts.js b/redakcja/static/js/button_scripts.js index 6e729157..37f37a7d 100644 --- a/redakcja/static/js/button_scripts.js +++ b/redakcja/static/js/button_scripts.js @@ -307,22 +307,26 @@ ScriptletCenter.prototype.callInteractive = function(opts) { $.blockUI({message: $progress, showOverlay: false}); + $('#save-button').attr('disabled', true); var input = self.XMLEditorSelectedText(opts.context); - self.scriptlets[opts.action](opts.context, opts.extra, input, 0, 0, function(output, move_forward, move_up){ - /*if(timer) - clearTimeout(timer); - else */ - if (input != output) { - self.XMLEditorReplaceSelectedText(opts.context, output) - } - if (move_forward || move_up) { - try { - self.XMLEditorMoveCursorForward(opts.context, move_forward, move_up) + window.setTimeout(function() { + self.scriptlets[opts.action](opts.context, opts.extra, input, 0, 0, function(output, move_forward, move_up){ + /*if(timer) + clearTimeout(timer); + else */ + if (input != output) { + self.XMLEditorReplaceSelectedText(opts.context, output) } - catch(e) {} - } - $.unblockUI(); // done - }); + if (move_forward || move_up) { + try { + self.XMLEditorMoveCursorForward(opts.context, move_forward, move_up) + } + catch(e) {} + } + $.unblockUI({onUnblock: function() { $('#save-button').attr('disabled', null)}}); // done + }); + }, 0); + } ScriptletCenter.prototype.XMLEditorSelectedText = function(editor) {