mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-25 10:59:28 +08:00
Merge pull request #1307 from ONLYOFFICE/fix/bugfix
[SSE] Bug 53654: don't show hidden sheets in protected workbook
This commit is contained in:
@ -193,15 +193,16 @@ define([
|
||||
},
|
||||
|
||||
onChangeProtectWorkbook: function() {
|
||||
this.statusbar.btnAddWorksheet.setDisabled(this.api.isCellEdited || this.api.asc_isWorkbookLocked() || this.api.asc_isProtectedWorkbook() || this.statusbar.rangeSelectionMode!=Asc.c_oAscSelectionDialogType.None);
|
||||
var count = this.statusbar.tabbar.getCount(), tab;
|
||||
var wbprotected = this.api.asc_isProtectedWorkbook();
|
||||
this.statusbar.btnAddWorksheet.setDisabled(this.api.isCellEdited || this.api.asc_isWorkbookLocked() || wbprotected || this.statusbar.rangeSelectionMode!=Asc.c_oAscSelectionDialogType.None);
|
||||
var count = this.statusbar.tabbar.getCount(), tab;
|
||||
for (var i = count; i-- > 0; ) {
|
||||
tab = this.statusbar.tabbar.getAt(i);
|
||||
var islocked = tab.hasClass('coauth-locked');
|
||||
tab.isLockTheDrag = islocked || wbprotected || (this.statusbar.rangeSelectionMode==Asc.c_oAscSelectionDialogType.FormatTable) || (this.statusbar.rangeSelectionMode==Asc.c_oAscSelectionDialogType.PrintTitles);
|
||||
tab.$el.children(':first-child').attr('draggable', tab.isLockTheDrag?'false':'true');
|
||||
}
|
||||
this.statusbar.update();
|
||||
},
|
||||
|
||||
/** coauthoring end **/
|
||||
|
||||
@ -553,10 +553,9 @@ define([
|
||||
iconTitle : name,
|
||||
iconVisible : name!==''
|
||||
};
|
||||
|
||||
this.api.asc_isWorksheetHidden(i)? hidentems.push(tab) : items.push(tab);
|
||||
|
||||
allItems.push(tab);
|
||||
var hidden = this.api.asc_isWorksheetHidden(i);
|
||||
hidden ? hidentems.push(tab) : items.push(tab);
|
||||
(!hidden || !wbprotected) && allItems.push(tab);
|
||||
}
|
||||
|
||||
if (hidentems.length) {
|
||||
@ -600,7 +599,7 @@ define([
|
||||
if (!this.tabbar.isTabVisible(sindex))
|
||||
this.tabbar.setTabVisible(sindex);
|
||||
|
||||
this.btnAddWorksheet.setDisabled(me.mode.isDisconnected || me.api.asc_isWorkbookLocked() || me.api.asc_isProtectedWorkbook() || me.api.isCellEdited);
|
||||
this.btnAddWorksheet.setDisabled(me.mode.isDisconnected || me.api.asc_isWorkbookLocked() || wbprotected || me.api.isCellEdited);
|
||||
if (this.mode.isEdit) {
|
||||
this.tabbar.addDataHint(_.findIndex(items, function (item) {
|
||||
return item.sheetindex === sindex;
|
||||
|
||||
Reference in New Issue
Block a user