diff --git a/apps/documenteditor/main/app/controller/DocProtection.js b/apps/documenteditor/main/app/controller/DocProtection.js index 959b9985f..d4180af29 100644 --- a/apps/documenteditor/main/app/controller/DocProtection.js +++ b/apps/documenteditor/main/app/controller/DocProtection.js @@ -53,7 +53,8 @@ define([ docLockView: 'lock-mode-view', docLockForms: 'lock-mode-forms', docLockReview: 'lock-mode-review', - docLockComments: 'lock-mode-comments' + docLockComments: 'lock-mode-comments', + protectLock: 'protect-lock' }; for (var key in enumLock) { if (enumLock.hasOwnProperty(key)) { @@ -88,6 +89,7 @@ define([ if (api) { this.api = api; this.api.asc_registerCallback('asc_onChangeDocumentProtection',_.bind(this.onChangeProtectDocument, this)); + this.api.asc_registerCallback('asc_onLockDocumentProtection',_.bind(this.onLockDocumentProtection, this)); } }, @@ -230,6 +232,10 @@ define([ } else this.api.asc_setRestriction(Asc.c_oAscRestrictionType.None); } + }, + + onLockDocumentProtection: function(state) { + this.view && Common.Utils.lockControls(Common.enumLock.protectLock, state, {array: [this.view.btnProtectDoc]}); } }, DE.Controllers.DocProtection || {})); diff --git a/apps/documenteditor/main/app/view/DocProtection.js b/apps/documenteditor/main/app/view/DocProtection.js index eb4945b63..1963ab351 100644 --- a/apps/documenteditor/main/app/view/DocProtection.js +++ b/apps/documenteditor/main/app/view/DocProtection.js @@ -79,7 +79,7 @@ define([ iconCls: 'toolbar__icon protect-workbook', enableToggle: true, caption: this.txtProtectDoc, - lock : [_set.lostConnect, _set.coAuth, _set.previewReviewMode, _set.viewFormMode], + lock : [_set.lostConnect, _set.coAuth, _set.previewReviewMode, _set.viewFormMode, _set.protectLock], dataHint : '1', dataHintDirection: 'bottom', dataHintOffset: 'small'