Commit 24e16630 authored by Julia Radzhabova's avatar Julia Radzhabova

[SSE] Use asc_getLockedTable() instead of cellinfo.asc_getLocked() for...

[SSE] Use asc_getLockedTable() instead of cellinfo.asc_getLocked() for detecting if the table is locked.
parent 0c9a6d4f
......@@ -1141,6 +1141,7 @@ define([
documentHolder = this.documentHolder,
seltype = cellinfo.asc_getFlags().asc_getSelectionType(),
isCellLocked = cellinfo.asc_getLocked(),
isTableLocked = cellinfo.asc_getLockedTable()===true,
isObjLocked = false,
commentsController = this.getApplication().getController('Common.Controllers.Comments'),
insfunc = false,
......@@ -1341,9 +1342,15 @@ define([
item.setDisabled(isCellLocked);
});
documentHolder.pmiCopy.setDisabled(false);
documentHolder.pmiFilterCells.setDisabled(isCellLocked || (filterInfo==null));
documentHolder.pmiSortCells.setDisabled(isCellLocked || (filterInfo==null));
documentHolder.pmiReapply.setDisabled(isCellLocked || (isApplyAutoFilter!==true));
documentHolder.pmiInsertEntire.setDisabled(isCellLocked || isTableLocked);
documentHolder.pmiInsertCells.setDisabled(isCellLocked || isTableLocked);
documentHolder.pmiInsertTable.setDisabled(isCellLocked || isTableLocked);
documentHolder.pmiDeleteEntire.setDisabled(isCellLocked || isTableLocked);
documentHolder.pmiDeleteCells.setDisabled(isCellLocked || isTableLocked);
documentHolder.pmiDeleteTable.setDisabled(isCellLocked || isTableLocked);
documentHolder.pmiFilterCells.setDisabled(isCellLocked || isTableLocked|| (filterInfo==null));
documentHolder.pmiSortCells.setDisabled(isCellLocked || isTableLocked|| (filterInfo==null));
documentHolder.pmiReapply.setDisabled(isCellLocked || isTableLocked|| (isApplyAutoFilter!==true));
if (showMenu) this.showPopupMenu(documentHolder.ssMenu, {}, event);
} else if (this.permissions.isEditDiagram && seltype == Asc.c_oAscSelectionType.RangeChartText) {
if (!showMenu && !documentHolder.textInShapeMenu.isVisible()) return;
......
......@@ -121,9 +121,10 @@ define([
this._openRightMenu = true;
}
var need_disable = info.asc_getLocked();
var need_disable = info.asc_getLocked(),
need_disable_table = (info.asc_getLockedTable()===true);
this.onFocusObject(SelectedObjects, formatTableInfo, sparkLineInfo, need_disable);
this.onFocusObject(SelectedObjects, formatTableInfo, sparkLineInfo, need_disable, need_disable_table);
if (this._state.prevDisabled != need_disable) {
this._state.prevDisabled = need_disable;
......@@ -133,7 +134,7 @@ define([
}
},
onFocusObject: function(SelectedObjects, formatTableInfo, sparkLineInfo, isCellLocked) {
onFocusObject: function(SelectedObjects, formatTableInfo, sparkLineInfo, isCellLocked, isTableLocked) {
if (!this.editMode)
return;
......@@ -174,7 +175,7 @@ define([
if (formatTableInfo) {
settingsType = Common.Utils.documentSettingsType.Table;
this._settings[settingsType].props = formatTableInfo;
this._settings[settingsType].locked = isCellLocked;
this._settings[settingsType].locked = isTableLocked;
this._settings[settingsType].hidden = 0;
}
......
......@@ -1604,7 +1604,7 @@ define([
if (!this.editMode) return;
var selectionType = info.asc_getFlags().asc_getSelectionType(),
coauth_disable = (!this.toolbar.mode.isEditMailMerge && !this.toolbar.mode.isEditDiagram) ? (info.asc_getLocked()===true) : false,
coauth_disable = (!this.toolbar.mode.isEditMailMerge && !this.toolbar.mode.isEditDiagram) ? (info.asc_getLocked()===true || info.asc_getLockedTable()===true) : false,
editOptionsDisabled = this._disableEditOptions(selectionType, coauth_disable),
me = this,
toolbar = this.toolbar,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment