From 09a27c30b8286f2234fee5b621dcedfefdff63a6 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 29 Apr 2021 15:41:04 +0300 Subject: [PATCH] For Bug 50113 --- apps/common/main/lib/component/Window.js | 6 ++++++ apps/common/main/lib/view/AdvancedSettingsWindow.js | 6 ++++++ .../main/app/view/PageMarginsDialog.js | 12 ++++++++---- .../main/app/view/ParagraphSettingsAdvanced.js | 10 +++++++--- .../main/app/view/ParagraphSettingsAdvanced.js | 10 +++++++--- .../main/app/view/ParagraphSettingsAdvanced.js | 10 +++++++--- 6 files changed, 41 insertions(+), 13 deletions(-) diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index ec1175730..661424bc2 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -769,6 +769,9 @@ define([ '-o-transform': 'scale(1)', 'opacity': '1' }); + setTimeout(function () { + me.fireEvent('animate:after', me); + }, 210); }, 1); setTimeout(function () { @@ -779,6 +782,9 @@ define([ this.$window.css({opacity: 1}); this.$window.addClass('notransform'); this.fireEvent('show', this); + setTimeout(function () { + me.fireEvent('animate:after', me); + }, 10); } Common.NotificationCenter.trigger('window:show', this); diff --git a/apps/common/main/lib/view/AdvancedSettingsWindow.js b/apps/common/main/lib/view/AdvancedSettingsWindow.js index 108adb385..25221ec4d 100644 --- a/apps/common/main/lib/view/AdvancedSettingsWindow.js +++ b/apps/common/main/lib/view/AdvancedSettingsWindow.js @@ -86,6 +86,8 @@ define([ var $window = this.getChild(); $window.find('.dlg-btn').on('click', _.bind(this.onDlgBtnClick, this)); + this.on('animate:after', _.bind(this.onAnimateAfter, this)); + this.btnsCategory = []; _.each($window.find('.btn-category'), function(item, index) { var btnEl = $(item); @@ -173,6 +175,10 @@ define([ if (this.storageName) Common.localStorage.setItem(this.storageName, this.getActiveCategory()); Common.UI.Window.prototype.close.call(this, suppressevent); + }, + + onAnimateAfter: function() { + } }, Common.Views.AdvancedSettingsWindow || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/view/PageMarginsDialog.js b/apps/documenteditor/main/app/view/PageMarginsDialog.js index 9cacd6a63..cdb98130c 100644 --- a/apps/documenteditor/main/app/view/PageMarginsDialog.js +++ b/apps/documenteditor/main/app/view/PageMarginsDialog.js @@ -305,6 +305,8 @@ define([ this.window = this.getChild(); this.window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); + this.on('animate:after', _.bind(this.onAnimateAfter, this)); + this.updateMetricUnit(); }, @@ -316,6 +318,12 @@ define([ return this.spnTop; }, + onAnimateAfter: function() { + if (this.api && this.properties) { + this.api.SetDrawImagePreviewMargins('page-margins-preview', this.properties); + } + }, + _handleInput: function(state) { if (this.options.handler) { if (state == 'ok') { @@ -374,10 +382,6 @@ define([ this.cmbGutterPosition.setValue(0); } this.cmbGutterPosition.setDisabled(mirrorMargins); - - if (this.api) { - this.api.SetDrawImagePreviewMargins('page-margins-preview', this.properties); - } } }, diff --git a/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js b/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js index 88c1447ae..d9a3ea289 100644 --- a/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js @@ -687,7 +687,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem ]; }, - onCategoryClick: function(btn, index) { + onCategoryClick: function(btn, index, cmp, e) { Common.Views.AdvancedSettingsWindow.prototype.onCategoryClick.call(this, btn, index); var me = this; @@ -698,8 +698,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem break; case 3: me.numSpacing.focus(); - var properties = (me._originalProps) ? me._originalProps : new Asc.asc_CParagraphProperty(); - me.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties); + if (e && (e instanceof jQuery.Event)) + me.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', me._originalProps || new Asc.asc_CParagraphProperty()); break; case 4: me.numDefaultTab.focus(); @@ -711,6 +711,10 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem }, 10); }, + onAnimateAfter: function() { + (this.getActiveCategory()==3) && this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', this._originalProps || new Asc.asc_CParagraphProperty()); + }, + getSettings: function() { if ( this.ChangedBorders === null ) { this._changedProps.put_Borders(this.Borders); diff --git a/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js index bbd577d93..c7e40f81f 100644 --- a/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js +++ b/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js @@ -414,7 +414,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced ]; }, - onCategoryClick: function(btn, index) { + onCategoryClick: function(btn, index, cmp, e) { Common.Views.AdvancedSettingsWindow.prototype.onCategoryClick.call(this, btn, index); var me = this; @@ -425,6 +425,8 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced break; case 1: me.numSpacing.focus(); + if (e && (e instanceof jQuery.Event)) + me.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', me._originalProps || new Asc.asc_CParagraphProperty()); break; case 2: me.numDefaultTab.focus(); @@ -433,6 +435,10 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced }, 10); }, + onAnimateAfter: function() { + (this.getActiveCategory()==1) && this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', this._originalProps || new Asc.asc_CParagraphProperty()); + }, + getSettings: function() { if ( this._tabListChanged ) { if (this._changedProps.get_Tabs()===null || this._changedProps.get_Tabs()===undefined) @@ -494,8 +500,6 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced this.numSpacing.setValue((props.get_TextSpacing() !== null && props.get_TextSpacing() !== undefined) ? Common.Utils.Metric.fnRecalcFromMM(props.get_TextSpacing()) : '', true); - this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', this._originalProps); - // Tabs this.numDefaultTab.setValue((props.get_DefaultTab() !== null && props.get_DefaultTab() !== undefined) ? Common.Utils.Metric.fnRecalcFromMM(parseFloat(props.get_DefaultTab().toFixed(1))) : '', true); diff --git a/apps/spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced.js b/apps/spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced.js index dae5fa399..d9137d3aa 100644 --- a/apps/spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced.js +++ b/apps/spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced.js @@ -412,7 +412,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced. ]; }, - onCategoryClick: function(btn, index) { + onCategoryClick: function(btn, index, cmp, e) { Common.Views.AdvancedSettingsWindow.prototype.onCategoryClick.call(this, btn, index); var me = this; @@ -423,6 +423,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced. break; case 1: me.numSpacing.focus(); + if (e && (e instanceof jQuery.Event)) + me.api.asc_setDrawImagePlaceParagraph('paragraphadv-font-img', me._originalProps || new Asc.asc_CParagraphProperty()); break; case 2: me.numDefaultTab.focus(); @@ -431,6 +433,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced. }, 10); }, + onAnimateAfter: function() { + (this.getActiveCategory()==1) && this.api.asc_setDrawImagePlaceParagraph('paragraphadv-font-img', this._originalProps || new Asc.asc_CParagraphProperty()); + }, + getSettings: function() { if ( this._tabListChanged ) { if (this._changedProps.asc_getTabs()===null || this._changedProps.asc_getTabs()===undefined) @@ -489,8 +495,6 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced. this.numSpacing.setValue((props.asc_getTextSpacing() !== null && props.asc_getTextSpacing() !== undefined) ? Common.Utils.Metric.fnRecalcFromMM(props.asc_getTextSpacing()) : '', true); - this.api.asc_setDrawImagePlaceParagraph('paragraphadv-font-img', this._originalProps); - // Tabs this.numDefaultTab.setValue((props.asc_getDefaultTab() !== null && props.asc_getDefaultTab() !== undefined) ? Common.Utils.Metric.fnRecalcFromMM(parseFloat(props.asc_getDefaultTab().toFixed(1))) : '', true);