[SSE] Disable name manager on protected sheet.
Disable adding comments when objects are protected
This commit is contained in:
parent
85882cf113
commit
cda49d94f8
|
@ -316,6 +316,7 @@ define([
|
|||
}
|
||||
prev_name = name;
|
||||
});
|
||||
this.editor.btnNamedRanges.menu.items[0].setDisabled(!!this.api.asc_isProtectedSheet());
|
||||
this.editor.btnNamedRanges.menu.items[1].setVisible(rangesMenu.items.length>2);
|
||||
},
|
||||
|
||||
|
|
|
@ -701,6 +701,8 @@ define([
|
|||
},
|
||||
|
||||
onAddComment: function(item) {
|
||||
if (this._state.wsProps['Objects']) return;
|
||||
|
||||
if (this.api && this.permissions.canCoAuthoring && this.permissions.canComments) {
|
||||
|
||||
var controller = SSE.getController('Common.Controllers.Comments'),
|
||||
|
@ -2111,6 +2113,7 @@ define([
|
|||
documentHolder.pmiSparklines.setDisabled(isCellLocked || this._state.wsLock);
|
||||
documentHolder.pmiEntriesList.setDisabled(isCellLocked || this._state.wsLock);
|
||||
documentHolder.pmiAddNamedRange.setDisabled(isCellLocked || this._state.wsLock);
|
||||
documentHolder.pmiAddComment.setDisabled(isCellLocked || this._state.wsProps['Objects']);
|
||||
|
||||
if (inPivot) {
|
||||
var canGroup = this.api.asc_canGroupPivot();
|
||||
|
@ -2182,7 +2185,7 @@ define([
|
|||
|
||||
documentHolder.menuViewAddComment.setVisible(canComment);
|
||||
commentsController && commentsController.blockPopover(true);
|
||||
documentHolder.menuViewAddComment.setDisabled(isCellLocked || isTableLocked);
|
||||
documentHolder.menuViewAddComment.setDisabled(isCellLocked || isTableLocked || this._state.wsProps['Objects']);
|
||||
if (showMenu) this.showPopupMenu(documentHolder.viewModeMenu, {}, event);
|
||||
|
||||
if (isInSign) {
|
||||
|
|
|
@ -3762,7 +3762,8 @@ define([
|
|||
this.btnsComment = [];
|
||||
if ( config.canCoAuthoring && config.canComments ) {
|
||||
var _set = SSE.enumLock;
|
||||
this.btnsComment = Common.Utils.injectButtons(this.toolbar.$el.find('.slot-comment'), 'tlbtn-addcomment-', 'toolbar__icon btn-menu-comments', this.toolbar.capBtnComment, [_set.lostConnect, _set.commentLock, _set.editCell], undefined, undefined, undefined, '1', 'bottom', 'small');
|
||||
this.btnsComment = Common.Utils.injectButtons(this.toolbar.$el.find('.slot-comment'), 'tlbtn-addcomment-', 'toolbar__icon btn-menu-comments', this.toolbar.capBtnComment,
|
||||
[_set.lostConnect, _set.commentLock, _set.editCell, _set['Objects']], undefined, undefined, undefined, '1', 'bottom', 'small');
|
||||
|
||||
if ( this.btnsComment.length ) {
|
||||
var _comments = SSE.getController('Common.Controllers.Comments').getView();
|
||||
|
|
Loading…
Reference in a new issue