Commit 8c9c4cbd authored by Julia Radzhabova's avatar Julia Radzhabova

[Mobile] Bug 35768.

parent e7d7f871
...@@ -457,6 +457,9 @@ define([ ...@@ -457,6 +457,9 @@ define([
if (this._isDocReady) if (this._isDocReady)
return; return;
if (this._state.openDlg)
uiApp.closeModal(this._state.openDlg);
var me = this, var me = this,
value; value;
...@@ -983,8 +986,10 @@ define([ ...@@ -983,8 +986,10 @@ define([
}, },
onAdvancedOptions: function(advOptions) { onAdvancedOptions: function(advOptions) {
if (this._state.openDlg) return;
var type = advOptions.asc_getOptionId(), var type = advOptions.asc_getOptionId(),
me = this, modal; me = this;
if (type == Asc.c_oAscAdvancedOptionsID.TXT) { if (type == Asc.c_oAscAdvancedOptionsID.TXT) {
var picker, var picker,
pages = [], pages = [],
...@@ -999,7 +1004,7 @@ define([ ...@@ -999,7 +1004,7 @@ define([
me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
modal = uiApp.modal({ me._state.openDlg = uiApp.modal({
title: me.advTxtOptions, title: me.advTxtOptions,
text: '', text: '',
afterText: afterText:
...@@ -1023,6 +1028,7 @@ define([ ...@@ -1023,6 +1028,7 @@ define([
me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
} }
} }
me._state.openDlg = null;
} }
} }
] ]
...@@ -1040,8 +1046,8 @@ define([ ...@@ -1040,8 +1046,8 @@ define([
}); });
// Vertical align // Vertical align
$$(modal).css({ $$(me._state.openDlg).css({
marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px' marginTop: - Math.round($$(me._state.openDlg).outerHeight() / 2) + 'px'
}); });
} else if (type == Asc.c_oAscAdvancedOptionsID.DRM) { } else if (type == Asc.c_oAscAdvancedOptionsID.DRM) {
...@@ -1049,7 +1055,7 @@ define([ ...@@ -1049,7 +1055,7 @@ define([
me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
modal = uiApp.modal({ me._state.openDlg = uiApp.modal({
title: me.advDRMOptions, title: me.advDRMOptions,
text: me.advDRMEnterPassword, text: me.advDRMEnterPassword,
afterText: '<div class="input-field"><input type="password" name="modal-password" placeholder="' + me.advDRMPassword + '" class="modal-text-input"></div>', afterText: '<div class="input-field"><input type="password" name="modal-password" placeholder="' + me.advDRMPassword + '" class="modal-text-input"></div>',
...@@ -1058,20 +1064,21 @@ define([ ...@@ -1058,20 +1064,21 @@ define([
text: 'OK', text: 'OK',
bold: true, bold: true,
onClick: function () { 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)); me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(password));
if (!me._isDocReady) { if (!me._isDocReady) {
me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
} }
me._state.openDlg = null;
} }
} }
] ]
}); });
// Vertical align // Vertical align
$$(modal).css({ $$(me._state.openDlg).css({
marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px' marginTop: - Math.round($$(me._state.openDlg).outerHeight() / 2) + 'px'
}); });
} }
}, },
......
...@@ -443,6 +443,9 @@ define([ ...@@ -443,6 +443,9 @@ define([
if (this._isDocReady) if (this._isDocReady)
return; return;
if (this._state.openDlg)
uiApp.closeModal(this._state.openDlg);
var me = this, var me = this,
value; value;
...@@ -994,15 +997,17 @@ define([ ...@@ -994,15 +997,17 @@ define([
}, },
onAdvancedOptions: function(advOptions) { onAdvancedOptions: function(advOptions) {
if (this._state.openDlg) return;
var type = advOptions.asc_getOptionId(), var type = advOptions.asc_getOptionId(),
me = this, modal; me = this;
if (type == Asc.c_oAscAdvancedOptionsID.DRM) { if (type == Asc.c_oAscAdvancedOptionsID.DRM) {
$(me.loadMask).hasClass('modal-in') && uiApp.closeModal(me.loadMask); $(me.loadMask).hasClass('modal-in') && uiApp.closeModal(me.loadMask);
me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
modal = uiApp.modal({ me._state.openDlg = uiApp.modal({
title: me.advDRMOptions, title: me.advDRMOptions,
text: me.advDRMEnterPassword, text: me.advDRMEnterPassword,
afterText: '<div class="input-field"><input type="password" name="modal-password" placeholder="' + me.advDRMPassword + '" class="modal-text-input"></div>', afterText: '<div class="input-field"><input type="password" name="modal-password" placeholder="' + me.advDRMPassword + '" class="modal-text-input"></div>',
...@@ -1011,20 +1016,21 @@ define([ ...@@ -1011,20 +1016,21 @@ define([
text: 'OK', text: 'OK',
bold: true, bold: true,
onClick: function () { 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)); me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(password));
if (!me._isDocReady) { if (!me._isDocReady) {
me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
} }
me._state.openDlg = null;
} }
} }
] ]
}); });
// Vertical align // Vertical align
$$(modal).css({ $$(me._state.openDlg).css({
marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px' marginTop: - Math.round($$(me._state.openDlg).outerHeight() / 2) + 'px'
}); });
} }
}, },
......
...@@ -455,6 +455,9 @@ define([ ...@@ -455,6 +455,9 @@ define([
if (this._isDocReady) if (this._isDocReady)
return; return;
if (this._state.openDlg)
uiApp.closeModal(this._state.openDlg);
var me = this, var me = this,
value; value;
...@@ -1099,8 +1102,10 @@ define([ ...@@ -1099,8 +1102,10 @@ define([
}, },
onAdvancedOptions: function(advOptions) { onAdvancedOptions: function(advOptions) {
if (this._state.openDlg) return;
var type = advOptions.asc_getOptionId(), var type = advOptions.asc_getOptionId(),
me = this, modal; me = this;
if (type == Asc.c_oAscAdvancedOptionsID.CSV) { if (type == Asc.c_oAscAdvancedOptionsID.CSV) {
var picker, var picker,
pages = [], pages = [],
...@@ -1115,7 +1120,7 @@ define([ ...@@ -1115,7 +1120,7 @@ define([
me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
modal = uiApp.modal({ me._state.openDlg = uiApp.modal({
title: me.advCSVOptions, title: me.advCSVOptions,
text: '', text: '',
afterText: afterText:
...@@ -1141,6 +1146,7 @@ define([ ...@@ -1141,6 +1146,7 @@ define([
me.onLongActionBegin(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); me.onLongActionBegin(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
} }
} }
me._state.openDlg = null;
} }
} }
] ]
...@@ -1169,15 +1175,15 @@ define([ ...@@ -1169,15 +1175,15 @@ define([
}); });
// Vertical align // Vertical align
$$(modal).css({ $$(me._state.openDlg).css({
marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px' marginTop: - Math.round($$(me._state.openDlg).outerHeight() / 2) + 'px'
}); });
} else if (type == Asc.c_oAscAdvancedOptionsID.DRM) { } else if (type == Asc.c_oAscAdvancedOptionsID.DRM) {
$(me.loadMask).hasClass('modal-in') && uiApp.closeModal(me.loadMask); $(me.loadMask).hasClass('modal-in') && uiApp.closeModal(me.loadMask);
me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
modal = uiApp.modal({ me._state.openDlg = uiApp.modal({
title: me.advDRMOptions, title: me.advDRMOptions,
text: me.advDRMEnterPassword, text: me.advDRMEnterPassword,
afterText: '<div class="input-field"><input type="password" name="modal-password" placeholder="' + me.advDRMPassword + '" class="modal-text-input"></div>', afterText: '<div class="input-field"><input type="password" name="modal-password" placeholder="' + me.advDRMPassword + '" class="modal-text-input"></div>',
...@@ -1186,20 +1192,21 @@ define([ ...@@ -1186,20 +1192,21 @@ define([
text: 'OK', text: 'OK',
bold: true, bold: true,
onClick: function () { 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)); me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(password));
if (!me._isDocReady) { if (!me._isDocReady) {
me.onLongActionBegin(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); me.onLongActionBegin(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
} }
me._state.openDlg = null;
} }
} }
] ]
}); });
// Vertical align // Vertical align
$$(modal).css({ $$(me._state.openDlg).css({
marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px' marginTop: - Math.round($$(me._state.openDlg).outerHeight() / 2) + 'px'
}); });
} }
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment