fixed move or copy index

This commit is contained in:
nikita_bartoshuk
2025-10-17 12:03:20 +03:00
parent 8f8b39e173
commit 0fc0ba81bb
2 changed files with 9 additions and 2 deletions

View File

@ -740,6 +740,7 @@ define([
spreadsheetName: me.api.asc_getDocumentName(),
isDesktopApp: me.statusbar.mode.isDesktopApp,
isOffline: me.statusbar.mode.isOffline,
hiddenWorksheets: me.statusbar.getHiddenWorksheets(),
handler : function(result, i, copy, workbook) {
btn = result;
if (btn == 'ok') {

View File

@ -444,6 +444,7 @@ define([
update: function() {
var me = this;
me.hiddenWorksheets = [];
var renamingWorksheet = this.controller && this.controller.renamingWorksheet;
this.tabbar.empty(true);
this.tabMenu.items[5].menu.removeAll();
@ -506,6 +507,7 @@ define([
allItems.forEach(function(item){
var hidden = me.api.asc_isWorksheetHidden(item.sheetindex);
hidden && me.hiddenWorksheets.push(item);
me.sheetListMenu.addItem(new Common.UI.MenuItem({
style: 'white-space: pre',
caption: Common.Utils.String.htmlEncode(item.label),
@ -550,6 +552,10 @@ define([
}
},
getHiddenWorksheets: function () {
return this.hiddenWorksheets;
},
onUpdateSheetViewSettings: function() {
this.updateRtlSheet();
},
@ -1341,7 +1347,7 @@ define([
var active = this.listNames.getSelectedRec(),
index = active ? active.get('inindex') : 0;
if (index === -255)
index = this.listNames.store.length - 1;
index = this.listNames.store.length - 1 + this.options.hiddenWorksheets.length;
var record = this.cmbSpreadsheet.getSelectedRecord();
this.options.handler.call(this,
@ -1356,7 +1362,7 @@ define([
var active = this.listNames.getSelectedRec(),
index = active ? active.get('inindex') : 0;
if (index === -255)
index = this.listNames.store.length - 1;
index = this.listNames.store.length - 1 + this.options.hiddenWorksheets.length;
var record = this.cmbSpreadsheet.getSelectedRecord();
this.options.handler.call(this, 'ok', index, this.chCreateCopy.getValue()==='checked', record.value);