[SSE] Lock data group buttons

This commit is contained in:
Julia Radzhabova 2019-08-06 16:12:07 +03:00
parent 0c5a5e890c
commit 2b0fc8af7b
3 changed files with 11 additions and 3 deletions

View file

@ -78,6 +78,7 @@ define([
if (api) {
this.api = api;
this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onSelectionChanged, this));
this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onWorksheetLocked, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
}
@ -192,6 +193,12 @@ define([
this.api.asc_changeGroupDetails(false);
},
onWorksheetLocked: function(index,locked) {
if (index == this.api.asc_getActiveWorksheetIndex()) {
Common.Utils.lockControls(SSE.enumLock.sheetLock, locked, {array: [this.view.btnGroup, this.view.btnUngroup]});
}
},
textWizard: 'Text to Columns Wizard'
}, SSE.Controllers.DataTab || {}));

View file

@ -107,7 +107,7 @@ define([
caption: this.capBtnGroup,
split: false,
disabled: true,
lock: [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth]
lock: [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.sheetLock, _set.lostConnect, _set.coAuth]
});
Common.Utils.injectComponent($host.find('#slot-btn-group'), this.btnGroup);
this.lockedControls.push(this.btnGroup);
@ -119,7 +119,7 @@ define([
split: true,
menu: true,
disabled: true,
lock: [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth]
lock: [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.sheetLock, _set.lostConnect, _set.coAuth]
});
Common.Utils.injectComponent($host.find('#slot-btn-ungroup'), this.btnUngroup);
this.lockedControls.push(this.btnUngroup);

View file

@ -89,7 +89,8 @@ define([
printAreaLock: 'print-area-lock',
namedRangeLock: 'named-range-lock',
multiselectCols:'is-multiselect-cols',
headerLock: 'header-lock'
headerLock: 'header-lock',
sheetLock: 'sheet-lock'
};
SSE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend({