From 89fcdfbd27246f83af7e80771065bb8a0ddbccbc Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Thu, 15 Aug 2024 12:33:18 +0500 Subject: [PATCH] chore/se: optimize print render --- apps/spreadsheeteditor/main/app/controller/Print.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Print.js b/apps/spreadsheeteditor/main/app/controller/Print.js index 3d4cd03d67..6d443cf607 100644 --- a/apps/spreadsheeteditor/main/app/controller/Print.js +++ b/apps/spreadsheeteditor/main/app/controller/Print.js @@ -544,10 +544,10 @@ define([ }, registerControlEvents: function(panel) { + panel.cmbPaperSize.on('selected', _.bind(this.updatePrintRenderContainerSize, this)); panel.cmbPaperSize.on('selected', _.bind(this.propertyChange, this, panel)); - panel.cmbPaperSize.on('selected', _.bind(this.onChangeZoomToPage, this)); + panel.cmbPaperOrientation.on('selected', _.bind(this.updatePrintRenderContainerSize, this)); panel.cmbPaperOrientation.on('selected', _.bind(this.propertyChange, this, panel)); - panel.cmbPaperOrientation.on('selected', _.bind(this.onChangeZoomToPage, this)); panel.cmbLayout.on('selected', _.bind(this.propertyChange, this, panel, 'scale')); panel.cmbPaperMargins.on('selected', _.bind(this.propertyChange, this, panel, 'margins')); panel.chPrintGrid.on('change', _.bind(this.propertyChange, this, panel)); @@ -816,10 +816,11 @@ define([ onClickZoomToPageButton: function(button) { this.isPaperZoom = button.pressed; - this.onChangeZoomToPage(); + this.updatePrintRenderContainerSize(); + this.updatePreview(); }, - onChangeZoomToPage: function() { + updatePrintRenderContainerSize: function() { var $preview = $('#print-preview'); if (this.isPaperZoom) { @@ -838,7 +839,6 @@ define([ $('#print-preview-wrapper').css('display', this.isPaperZoom ? 'flex' : ''); this.printSettings.printScroller.scrollTop(0); - this.api.asc_drawPrintPreview(this._navigationPreview.currentPage); }, onPreviewWheel: function (e) {