From 62029e2d5d96829958dcd35de92b8ded41963605 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 8 Sep 2017 11:39:07 +0300 Subject: [PATCH] Bug 35768. --- apps/documenteditor/main/app/controller/Main.js | 17 ++++++++++++----- .../main/app/controller/Main.js | 14 ++++++++++---- .../main/app/controller/Main.js | 17 ++++++++++++----- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 123cfeb2bf..f59857066d 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -740,6 +740,9 @@ define([ if (this._isDocReady) return; + if (this._state.openDlg) + this._state.openDlg.close(); + var me = this, value; @@ -1722,10 +1725,12 @@ define([ }, onAdvancedOptions: function(advOptions) { + if (this._state.openDlg) return; + var type = advOptions.asc_getOptionId(), - me = this, dlg; + me = this; if (type == Asc.c_oAscAdvancedOptionsID.TXT) { - dlg = new Common.Views.OpenDialog({ + me._state.openDlg = new Common.Views.OpenDialog({ type: type, codepages: advOptions.asc_getOptions().asc_getCodePages(), settings: advOptions.asc_getOptions().asc_getRecommendedSettings(), @@ -1735,10 +1740,11 @@ define([ me.api.asc_setAdvancedOptions(type, new Asc.asc_CTXTAdvancedOptions(encoding)); me.loadMask && me.loadMask.show(); } + me._state.openDlg = null; } }); } else if (type == Asc.c_oAscAdvancedOptionsID.DRM) { - dlg = new Common.Views.OpenDialog({ + me._state.openDlg = new Common.Views.OpenDialog({ type: type, handler: function (value) { me.isShowOpenDialog = false; @@ -1746,14 +1752,15 @@ define([ me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(value)); me.loadMask && me.loadMask.show(); } + me._state.openDlg = null; } }); } - if (dlg) { + if (me._state.openDlg) { this.isShowOpenDialog = true; this.loadMask && this.loadMask.hide(); this.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); - dlg.show(); + me._state.openDlg.show(); } }, diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 2243315717..75ea9b1d86 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -552,6 +552,9 @@ define([ if (this._isDocReady) return; + if (this._state.openDlg) + this._state.openDlg.close(); + var me = this, value; @@ -1601,10 +1604,12 @@ define([ }, onAdvancedOptions: function(advOptions) { + if (this._state.openDlg) return; + var type = advOptions.asc_getOptionId(), - me = this, dlg; + me = this; if (type == Asc.c_oAscAdvancedOptionsID.DRM) { - dlg = new Common.Views.OpenDialog({ + me._state.openDlg = new Common.Views.OpenDialog({ type: type, handler: function (value) { me.isShowOpenDialog = false; @@ -1612,14 +1617,15 @@ define([ me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(value)); me.loadMask && me.loadMask.show(); } + me._state.openDlg = null; } }); } - if (dlg) { + if (me._state.openDlg) { this.isShowOpenDialog = true; this.loadMask && this.loadMask.hide(); this.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); - dlg.show(); + me._state.openDlg.show(); } }, diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index a693e648d6..7ba1ccab0e 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -555,6 +555,9 @@ define([ if (this._isDocReady) return; + if (this._state.openDlg) + this._state.openDlg.close(); + var me = this, value; @@ -1420,10 +1423,12 @@ define([ }, onAdvancedOptions: function(advOptions) { + if (this._state.openDlg) return; + var type = advOptions.asc_getOptionId(), - me = this, dlg; + me = this; if (type == Asc.c_oAscAdvancedOptionsID.CSV) { - dlg = new Common.Views.OpenDialog({ + me._state.openDlg = new Common.Views.OpenDialog({ type: type, codepages: advOptions.asc_getOptions().asc_getCodePages(), settings: advOptions.asc_getOptions().asc_getRecommendedSettings(), @@ -1433,10 +1438,11 @@ define([ me.api.asc_setAdvancedOptions(type, new Asc.asc_CCSVAdvancedOptions(encoding, delimiter, delimiterChar)); me.loadMask && me.loadMask.show(); } + me._state.openDlg = null; } }); } else if (type == Asc.c_oAscAdvancedOptionsID.DRM) { - dlg = new Common.Views.OpenDialog({ + me._state.openDlg = new Common.Views.OpenDialog({ type: type, handler: function (value) { me.isShowOpenDialog = false; @@ -1444,14 +1450,15 @@ define([ me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(value)); me.loadMask && me.loadMask.show(); } + me._state.openDlg = null; } }); } - if (dlg) { + if (me._state.openDlg) { this.isShowOpenDialog = true; this.loadMask && this.loadMask.hide(); this.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); - dlg.show(); + me._state.openDlg.show(); } },