[SSE] Lock view settings
This commit is contained in:
parent
ce19f6f1fc
commit
1f49644924
|
@ -719,9 +719,11 @@ define([
|
|||
|
||||
fakeMenuItem: function() {
|
||||
return {
|
||||
conf: {checked: false},
|
||||
conf: {checked: false, disabled: false},
|
||||
setChecked: function (val) { this.conf.checked = val; },
|
||||
isChecked: function () { return this.conf.checked; }
|
||||
isChecked: function () { return this.conf.checked; },
|
||||
setDisabled: function (val) { this.conf.disabled = val; },
|
||||
isDisabled: function () { return this.conf.disabled; }
|
||||
};
|
||||
},
|
||||
|
||||
|
|
|
@ -3307,7 +3307,7 @@ define([
|
|||
|
||||
var viewtab = me.getApplication().getController('ViewTab');
|
||||
viewtab.setApi(me.api).setConfig({toolbar: me, mode: config});
|
||||
|
||||
Array.prototype.push.apply(me.toolbar.lockControls, viewtab.getView('ViewTab').getButtons());
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -65,7 +65,7 @@ define([
|
|||
this.api = api;
|
||||
this.api.asc_registerCallback('asc_onZoomChanged', this.onApiZoomChange.bind(this));
|
||||
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_onWorksheetLocked', _.bind(this.onWorksheetLocked, this));
|
||||
this.api.asc_registerCallback('asc_onSheetsChanged', this.onApiSheetChanged.bind(this));
|
||||
this.api.asc_registerCallback('asc_onUpdateSheetViewSettings', this.onApiSheetChanged.bind(this));
|
||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
|
||||
|
@ -185,11 +185,11 @@ define([
|
|||
}).show();
|
||||
},
|
||||
|
||||
// onWorksheetLocked: function(index,locked) {
|
||||
// if (index == this.api.asc_getActiveWorksheetIndex()) {
|
||||
// Common.Utils.lockControls(SSE.enumLock.sheetLock, locked, {array: this.view.btnsSortDown.concat(this.view.btnsSortUp, this.view.btnCustomSort, this.view.btnGroup, this.view.btnUngroup)});
|
||||
// }
|
||||
// },
|
||||
onWorksheetLocked: function(index,locked) {
|
||||
if (index == this.api.asc_getActiveWorksheetIndex()) {
|
||||
Common.Utils.lockControls(SSE.enumLock.sheetLock, locked, {array: [this.view.chHeadings, this.view.chGridlines, this.view.btnFreezePanes]});
|
||||
}
|
||||
},
|
||||
|
||||
onApiSheetChanged: function() {
|
||||
if (!this.toolbar.mode || !this.toolbar.mode.isEdit || this.toolbar.mode.isEditDiagram || this.toolbar.mode.isEditMailMerge) return;
|
||||
|
@ -199,8 +199,8 @@ define([
|
|||
this.view.chGridlines.setValue(!!params.asc_getShowGridLines(), true);
|
||||
this.view.btnFreezePanes.toggle(!!params.asc_getIsFreezePane(), true);
|
||||
|
||||
// var currentSheet = this.api.asc_getActiveWorksheetIndex();
|
||||
// this.onWorksheetLocked(currentSheet, this.api.asc_isWorksheetLockedOrDeleted(currentSheet));
|
||||
var currentSheet = this.api.asc_getActiveWorksheetIndex();
|
||||
this.onWorksheetLocked(currentSheet, this.api.asc_isWorksheetLockedOrDeleted(currentSheet));
|
||||
},
|
||||
|
||||
onLayoutChanged: function(area) {
|
||||
|
|
|
@ -125,6 +125,7 @@ define([
|
|||
this.api.asc_registerCallback('asc_onZoomChanged', this.onApiZoomChange.bind(this));
|
||||
this.api.asc_registerCallback('asc_onSheetsChanged', this.onApiSheetChanged.bind(this));
|
||||
this.api.asc_registerCallback('asc_onUpdateSheetViewSettings', this.onApiSheetChanged.bind(this));
|
||||
this.api.asc_registerCallback('asc_onWorksheetLocked', this.onWorksheetLocked.bind(this));
|
||||
this.api.asc_registerCallback('asc_onEditCell', this.onApiEditCell.bind(this));
|
||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',this.onApiCoAuthoringDisconnect.bind(this));
|
||||
Common.NotificationCenter.on('api:disconnect', this.onApiCoAuthoringDisconnect.bind(this));
|
||||
|
@ -218,6 +219,7 @@ define([
|
|||
caption : me.textHideHeadings,
|
||||
checkable : true,
|
||||
checked : me.header.mnuitemHideHeadings.isChecked(),
|
||||
disabled : me.header.mnuitemHideHeadings.isDisabled(),
|
||||
value : 'headings'
|
||||
});
|
||||
|
||||
|
@ -225,6 +227,7 @@ define([
|
|||
caption : me.textHideGridlines,
|
||||
checkable : true,
|
||||
checked : me.header.mnuitemHideGridlines.isChecked(),
|
||||
disabled : me.header.mnuitemHideGridlines.isDisabled(),
|
||||
value : 'gridlines'
|
||||
});
|
||||
|
||||
|
@ -232,6 +235,7 @@ define([
|
|||
caption : me.textFreezePanes,
|
||||
checkable : true,
|
||||
checked : me.header.mnuitemFreezePanes.isChecked(),
|
||||
disabled : me.header.mnuitemFreezePanes.isDisabled(),
|
||||
value : 'freezepanes'
|
||||
});
|
||||
|
||||
|
@ -434,6 +438,21 @@ define([
|
|||
me.header.mnuitemHideHeadings.setChecked(!params.asc_getShowRowColHeaders());
|
||||
me.header.mnuitemHideGridlines.setChecked(!params.asc_getShowGridLines());
|
||||
me.header.mnuitemFreezePanes.setChecked(params.asc_getIsFreezePane());
|
||||
|
||||
var currentSheet = me.api.asc_getActiveWorksheetIndex();
|
||||
this.onWorksheetLocked(currentSheet, this.api.asc_isWorksheetLockedOrDeleted(currentSheet));
|
||||
}
|
||||
},
|
||||
|
||||
onWorksheetLocked: function(index,locked) {
|
||||
var me = this;
|
||||
var appConfig = me.viewport.mode;
|
||||
if ( !!appConfig && !appConfig.isEditDiagram && !appConfig.isEditMailMerge ) {
|
||||
if (index == this.api.asc_getActiveWorksheetIndex()) {
|
||||
me.header.mnuitemHideHeadings.setDisabled(locked);
|
||||
me.header.mnuitemHideGridlines.setDisabled(locked);
|
||||
me.header.mnuitemFreezePanes.setDisabled(locked);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ define([
|
|||
caption: this.capBtnFreeze,
|
||||
split: false,
|
||||
enableToggle: true,
|
||||
lock: [_set.lostConnect, _set.coAuth]
|
||||
lock: [_set.sheetLock, _set.lostConnect, _set.coAuth]
|
||||
});
|
||||
this.lockedControls.push(this.btnFreezePanes);
|
||||
|
||||
|
@ -161,14 +161,14 @@ define([
|
|||
this.chHeadings = new Common.UI.CheckBox({
|
||||
el: $host.findById('#slot-chk-heading'),
|
||||
labelText: this.textHeadings,
|
||||
lock : [_set.lostConnect, _set.coAuth]
|
||||
lock : [_set.sheetLock, _set.lostConnect, _set.coAuth]
|
||||
});
|
||||
this.lockedControls.push(this.chHeadings);
|
||||
|
||||
this.chGridlines = new Common.UI.CheckBox({
|
||||
el: $host.findById('#slot-chk-gridlines'),
|
||||
labelText: this.textGridlines,
|
||||
lock : [_set.lostConnect, _set.coAuth]
|
||||
lock : [_set.sheetLock, _set.lostConnect, _set.coAuth]
|
||||
});
|
||||
this.lockedControls.push(this.chGridlines);
|
||||
|
||||
|
|
Loading…
Reference in a new issue