[DE] Fix Bug 44289

This commit is contained in:
Julia Radzhabova 2020-01-27 14:58:16 +03:00 committed by Alexey Golubev
parent 3c41a8a8db
commit 64d8f353ed
2 changed files with 15 additions and 2 deletions

View file

@ -844,7 +844,7 @@ define([
toolbar.btnEditHeader.setDisabled(in_equation);
need_disable = paragraph_locked || header_locked || in_image || control_plain || rich_edit_lock || plain_edit_lock;
need_disable = paragraph_locked || header_locked || in_image || control_plain || rich_edit_lock || plain_edit_lock || this._state.lock_doc;
if (need_disable != toolbar.btnColumns.isDisabled())
toolbar.btnColumns.setDisabled(need_disable);
@ -904,6 +904,7 @@ define([
if (this._state.lock_doc!==true) {
this.toolbar.btnPageOrient.setDisabled(true);
this.toolbar.btnPageSize.setDisabled(true);
this.toolbar.btnPageMargins.setDisabled(true);
if (this._state.activated) this._state.lock_doc = true;
}
},
@ -912,6 +913,7 @@ define([
if (this._state.lock_doc!==false) {
this.toolbar.btnPageOrient.setDisabled(false);
this.toolbar.btnPageSize.setDisabled(false);
this.toolbar.btnPageMargins.setDisabled(false);
if (this._state.activated) this._state.lock_doc = false;
}
},

View file

@ -85,7 +85,7 @@ define([
me._currentMathObj = undefined;
me._currentParaObjDisabled = false;
me._isDisabled = false;
me._state = {};
var showPopupMenu = function(menu, value, event, docElement, eOpts){
if (!_.isUndefined(menu) && menu !== null){
Common.UI.Menu.Manager.hideAll();
@ -1525,6 +1525,8 @@ define([
this.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(onSpellCheckVariantsFound, this));
this.api.asc_registerCallback('asc_onRulerDblClick', _.bind(this.onRulerDblClick, this));
this.api.asc_registerCallback('asc_ChangeCropState', _.bind(this.onChangeCropState, this));
this.api.asc_registerCallback('asc_onLockDocumentProps', _.bind(this.onApiLockDocumentProps, this));
this.api.asc_registerCallback('asc_onUnLockDocumentProps', _.bind(this.onApiUnLockDocumentProps, this));
}
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('api:disconnect', _.bind(onCoAuthoringDisconnect, this));
@ -1733,6 +1735,7 @@ define([
if (win)
win.setActiveCategory(type == 'indents' ? 0 : 3);
} else if (type == 'margins') {
if (me._state.lock_doc) return;
win = new DE.Views.PageMarginsDialog({
api: me.api,
handler: function(dlg, result) {
@ -4128,6 +4131,14 @@ define([
}
},
onApiLockDocumentProps: function() {
this._state.lock_doc = true;
},
onApiUnLockDocumentProps: function() {
this._state.lock_doc = false;
},
focus: function() {
var me = this;
_.defer(function(){ me.cmpEl.focus(); }, 50);