From b0a69a7f1d0358076972f70efeb14eca4eb3b0f5 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Thu, 25 Nov 2021 18:59:48 +0300 Subject: [PATCH] [SSE] Print preview: add update name of preview sheet --- apps/spreadsheeteditor/main/app/controller/Print.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/spreadsheeteditor/main/app/controller/Print.js b/apps/spreadsheeteditor/main/app/controller/Print.js index 46e08a8d2..3b7184e14 100644 --- a/apps/spreadsheeteditor/main/app/controller/Print.js +++ b/apps/spreadsheeteditor/main/app/controller/Print.js @@ -104,6 +104,7 @@ define([ setApi: function(o) { this.api = o; this.api.asc_registerCallback('asc_onSheetsChanged', _.bind(this.updateSheetsInfo, this)); + this.api.asc_registerCallback('asc_onPrintPreviewSheetChanged', _.bind(this.onApiChangePreviewSheet, this)); }, updateSheetsInfo: function() { @@ -685,6 +686,16 @@ define([ } }, + onApiChangePreviewSheet: function (index) { + var item = this.printSettings.cmbSheet.store.findWhere({value: index}); + if (item) { + this.printSettings.cmbSheet.setValue(item.get('value')); + this.comboSheetsChange(this.printSettings, this.printSettings.cmbSheet, item.toJSON()); + var sheetName = this.api.asc_getWorksheetName(index); + this.printSettings.updateActiveSheet(sheetName); + } + }, + warnCheckMargings: 'Margins are incorrect', strAllSheets: 'All Sheets', textWarning: 'Warning',