From f552caed5f25261e0a6a386bff6cb66305eaf410 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 8 Sep 2017 13:41:04 +0300 Subject: [PATCH] [Mobile] Bug 35768. --- .../mobile/app/controller/Main.js | 23 ++++++++++++------- .../mobile/app/controller/Main.js | 16 +++++++++---- .../mobile/app/controller/Main.js | 23 ++++++++++++------- 3 files changed, 41 insertions(+), 21 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index 9dfd11ee4..4200be534 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -456,6 +456,9 @@ define([ if (this._isDocReady) return; + if (this._state.openDlg) + uiApp.closeModal(this._state.openDlg); + var me = this, value; @@ -980,8 +983,10 @@ define([ }, onAdvancedOptions: function(advOptions) { + if (this._state.openDlg) return; + var type = advOptions.asc_getOptionId(), - me = this, modal; + me = this; if (type == Asc.c_oAscAdvancedOptionsID.TXT) { var picker, pages = [], @@ -996,7 +1001,7 @@ define([ me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); - modal = uiApp.modal({ + me._state.openDlg = uiApp.modal({ title: me.advTxtOptions, text: '', afterText: @@ -1020,6 +1025,7 @@ define([ me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); } } + me._state.openDlg = null; } } ] @@ -1037,8 +1043,8 @@ define([ }); // Vertical align - $$(modal).css({ - marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px' + $$(me._state.openDlg).css({ + marginTop: - Math.round($$(me._state.openDlg).outerHeight() / 2) + 'px' }); } else if (type == Asc.c_oAscAdvancedOptionsID.DRM) { @@ -1046,7 +1052,7 @@ define([ me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); - modal = uiApp.modal({ + me._state.openDlg = uiApp.modal({ title: me.advDRMOptions, text: me.advDRMEnterPassword, afterText: '
', @@ -1055,20 +1061,21 @@ define([ text: 'OK', bold: true, onClick: function () { - var password = $(modal).find('.modal-text-input[name="modal-password"]').val(); + var password = $(me._state.openDlg).find('.modal-text-input[name="modal-password"]').val(); me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(password)); if (!me._isDocReady) { me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); } + me._state.openDlg = null; } } ] }); // Vertical align - $$(modal).css({ - marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px' + $$(me._state.openDlg).css({ + marginTop: - Math.round($$(me._state.openDlg).outerHeight() / 2) + 'px' }); } }, diff --git a/apps/presentationeditor/mobile/app/controller/Main.js b/apps/presentationeditor/mobile/app/controller/Main.js index 59a3d1945..6d4e4ab23 100644 --- a/apps/presentationeditor/mobile/app/controller/Main.js +++ b/apps/presentationeditor/mobile/app/controller/Main.js @@ -443,6 +443,9 @@ define([ if (this._isDocReady) return; + if (this._state.openDlg) + uiApp.closeModal(this._state.openDlg); + var me = this, value; @@ -993,15 +996,17 @@ define([ }, onAdvancedOptions: function(advOptions) { + if (this._state.openDlg) return; + var type = advOptions.asc_getOptionId(), - me = this, modal; + me = this; if (type == Asc.c_oAscAdvancedOptionsID.DRM) { $(me.loadMask).hasClass('modal-in') && uiApp.closeModal(me.loadMask); me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); - modal = uiApp.modal({ + me._state.openDlg = uiApp.modal({ title: me.advDRMOptions, text: me.advDRMEnterPassword, afterText: '
', @@ -1010,20 +1015,21 @@ define([ text: 'OK', bold: true, onClick: function () { - var password = $(modal).find('.modal-text-input[name="modal-password"]').val(); + var password = $(me._state.openDlg).find('.modal-text-input[name="modal-password"]').val(); me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(password)); if (!me._isDocReady) { me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); } + me._state.openDlg = null; } } ] }); // Vertical align - $$(modal).css({ - marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px' + $$(me._state.openDlg).css({ + marginTop: - Math.round($$(me._state.openDlg).outerHeight() / 2) + 'px' }); } }, diff --git a/apps/spreadsheeteditor/mobile/app/controller/Main.js b/apps/spreadsheeteditor/mobile/app/controller/Main.js index fda935b09..87af5118f 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Main.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Main.js @@ -455,6 +455,9 @@ define([ if (this._isDocReady) return; + if (this._state.openDlg) + uiApp.closeModal(this._state.openDlg); + var me = this, value; @@ -1099,8 +1102,10 @@ define([ }, onAdvancedOptions: function(advOptions) { + if (this._state.openDlg) return; + var type = advOptions.asc_getOptionId(), - me = this, modal; + me = this; if (type == Asc.c_oAscAdvancedOptionsID.CSV) { var picker, pages = [], @@ -1115,7 +1120,7 @@ define([ me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); - modal = uiApp.modal({ + me._state.openDlg = uiApp.modal({ title: me.advCSVOptions, text: '', afterText: @@ -1141,6 +1146,7 @@ define([ me.onLongActionBegin(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); } } + me._state.openDlg = null; } } ] @@ -1169,15 +1175,15 @@ define([ }); // Vertical align - $$(modal).css({ - marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px' + $$(me._state.openDlg).css({ + marginTop: - Math.round($$(me._state.openDlg).outerHeight() / 2) + 'px' }); } else if (type == Asc.c_oAscAdvancedOptionsID.DRM) { $(me.loadMask).hasClass('modal-in') && uiApp.closeModal(me.loadMask); me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); - modal = uiApp.modal({ + me._state.openDlg = uiApp.modal({ title: me.advDRMOptions, text: me.advDRMEnterPassword, afterText: '
', @@ -1186,20 +1192,21 @@ define([ text: 'OK', bold: true, onClick: function () { - var password = $(modal).find('.modal-text-input[name="modal-password"]').val(); + var password = $(me._state.openDlg).find('.modal-text-input[name="modal-password"]').val(); me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(password)); if (!me._isDocReady) { me.onLongActionBegin(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); } + me._state.openDlg = null; } } ] }); // Vertical align - $$(modal).css({ - marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px' + $$(me._state.openDlg).css({ + marginTop: - Math.round($$(me._state.openDlg).outerHeight() / 2) + 'px' }); } },