[DE] Handle protection lock

This commit is contained in:
Julia Radzhabova 2022-10-06 20:14:13 +03:00
parent 52283a3d2e
commit ed621f0921
2 changed files with 8 additions and 2 deletions

View file

@ -53,7 +53,8 @@ define([
docLockView: 'lock-mode-view', docLockView: 'lock-mode-view',
docLockForms: 'lock-mode-forms', docLockForms: 'lock-mode-forms',
docLockReview: 'lock-mode-review', docLockReview: 'lock-mode-review',
docLockComments: 'lock-mode-comments' docLockComments: 'lock-mode-comments',
protectLock: 'protect-lock'
}; };
for (var key in enumLock) { for (var key in enumLock) {
if (enumLock.hasOwnProperty(key)) { if (enumLock.hasOwnProperty(key)) {
@ -88,6 +89,7 @@ define([
if (api) { if (api) {
this.api = api; this.api = api;
this.api.asc_registerCallback('asc_onChangeDocumentProtection',_.bind(this.onChangeProtectDocument, this)); 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 } else
this.api.asc_setRestriction(Asc.c_oAscRestrictionType.None); 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 || {})); }, DE.Controllers.DocProtection || {}));

View file

@ -79,7 +79,7 @@ define([
iconCls: 'toolbar__icon protect-workbook', iconCls: 'toolbar__icon protect-workbook',
enableToggle: true, enableToggle: true,
caption: this.txtProtectDoc, 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', dataHint : '1',
dataHintDirection: 'bottom', dataHintDirection: 'bottom',
dataHintOffset: 'small' dataHintOffset: 'small'