diff --git a/apps/common/main/lib/component/LoadMask.js b/apps/common/main/lib/component/LoadMask.js index 1742b2064..b67060b2b 100644 --- a/apps/common/main/lib/component/LoadMask.js +++ b/apps/common/main/lib/component/LoadMask.js @@ -104,38 +104,37 @@ define([ return this; }, - show: function(){ - // if (maskeEl || loaderEl) - // return; + internalShow: function() { + this.ownerEl.append(this.maskeEl); + this.ownerEl.append(this.loaderEl); + this.loaderEl.css('min-width', $('.asc-loadmask-title', this.loaderEl).width() + 105); + + if (this.ownerEl && this.ownerEl.closest('.asc-window.modal').length==0) + Common.util.Shortcuts.suspendEvents(); + }, + + show: function(immediately){ // The owner is already masked - var ownerEl = this.ownerEl, - loaderEl = this.loaderEl, - maskeEl = this.maskeEl; - if (!!ownerEl.ismasked) + if (!!this.ownerEl.ismasked) return this; - ownerEl.ismasked = true; + this.ownerEl.ismasked = true; var me = this; if (me.title != me.options.title) { me.options.title = me.title; - $('.asc-loadmask-title', loaderEl).html(me.title); + $('.asc-loadmask-title', this.loaderEl).html(me.title); } - // show mask after 500 ms if it wont be hided - me.timerId = setTimeout(function () { - ownerEl.append(maskeEl); - ownerEl.append(loaderEl); - - // if (ownerEl.height()<1 || ownerEl.width()<1) - // loaderEl.css({visibility: 'hidden'}); - - loaderEl.css('min-width', $('.asc-loadmask-title', loaderEl).width() + 105); - - if (ownerEl && ownerEl.closest('.asc-window.modal').length==0) - Common.util.Shortcuts.suspendEvents(); - },500); + if (immediately) { + me.internalShow(); + } else if (!me.timerId) { + // show mask after 500 ms if it wont be hided + me.timerId = setTimeout(function () { + me.internalShow(); + },500); + } return this; }, diff --git a/apps/common/main/lib/controller/History.js b/apps/common/main/lib/controller/History.js index 97efc03dc..502757238 100644 --- a/apps/common/main/lib/controller/History.js +++ b/apps/common/main/lib/controller/History.js @@ -177,6 +177,9 @@ define([ }; Common.UI.alert(config); } else { + if (this.currentRev !== opts.data.version) { + return; + } var commentsController = this.getApplication().getController('Common.Controllers.Comments'); if (commentsController) { commentsController.onApiHideComment(); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 8c34fb009..4e943d4cc 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -962,7 +962,7 @@ define([ this.loadMask.setTitle(title); if (!this.isShowOpenDialog) - this.loadMask.show(); + this.loadMask.show(action.id===Asc.c_oAscAsyncAction['Open']); } else { this.getApplication().getController('Statusbar').setStatusCaption(text, force); } diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index cd911a81c..081ca2880 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -709,7 +709,7 @@ define([ this.loadMask.setTitle(title); if (!this.isShowOpenDialog) - this.loadMask.show(); + this.loadMask.show(action.id===Asc.c_oAscAsyncAction['Open']); } else { this.getApplication().getController('Statusbar').setStatusCaption(text, force); }