Finishing the "Replacing text" label fade out after the save dialog
(or any other dialog) is made visible causes the BlockUI plugin to erase
its internal data necessary for restoring the dialog's html markup
to its original position and, as a result, to remove it from DOM tree
when dialog gets hidden. This makes it impossible to show this
dialog again.
Such a case could occur when text operation executed in the source editor
took a little bit longer.
This change fixes that by disabling the save button until the label
fades out.
$.blockUI({message: $progress, showOverlay: false});
$.blockUI({message: $progress, showOverlay: false});
+ $('#save-button').attr('disabled', true);
var input = self.XMLEditorSelectedText(opts.context);
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) {
}
ScriptletCenter.prototype.XMLEditorSelectedText = function(editor) {