From 8c463807b03b1cc3942b7a45f8f5027337389580 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 28 May 2019 16:08:51 +0300 Subject: [PATCH] [SSE] Fix bug with loading mask in header/footer dialog (can disable mask animation) --- apps/common/main/lib/component/Window.js | 8 ++++---- .../main/app/view/HeaderFooterDialog.js | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index cab94d7c4..752da533e 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -639,7 +639,10 @@ define([ show: function(x,y) { if (this.initConfig.modal) { var mask = _getMask(); - if (this.options.animate !== false) { + if (this.options.animate === false || this.options.animate && this.options.animate.mask === false) { // animate.mask = false -> don't animate mask + mask.attr('counter', parseInt(mask.attr('counter'))+1); + mask.show(); + } else { var opacity = mask.css('opacity'); mask.css('opacity', 0); mask.attr('counter', parseInt(mask.attr('counter'))+1); @@ -648,9 +651,6 @@ define([ setTimeout(function () { mask.css(_getTransformation(opacity)); }, 1); - } else { - mask.attr('counter', parseInt(mask.attr('counter'))+1); - mask.show(); } Common.NotificationCenter.trigger('modal:show', this); diff --git a/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js b/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js index 915682cc6..8ee3b5d13 100644 --- a/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js +++ b/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js @@ -50,7 +50,8 @@ define([ options: { width: 647, style: 'min-width: 350px;', - cls: 'modal-dlg enable-key-events' + cls: 'modal-dlg enable-key-events', + animate: {mask: false} }, initialize : function(options) { @@ -607,10 +608,6 @@ define([ show: function() { Common.UI.Window.prototype.show.apply(this, arguments); - var me = this; - _.delay(function(){ - me.onCanvasClick('#header-left-img'); - },500); }, close: function() { @@ -638,6 +635,10 @@ define([ this.HFObject = new AscCommonExcel.CHeaderFooterEditor(['header-left-img', 'header-center-img', 'header-right-img', 'footer-left-img', 'footer-center-img', 'footer-right-img'], 205); this._setDefaults(this.props); this.editorCanvas = this.$window.find('#ce-canvas-menu'); + var me = this; + _.delay(function(){ + me.onCanvasClick('#header-left-img'); + },500); }, _setDefaults: function (props) {