Merge pull request #1716 from ONLYOFFICE/fix/bug_56326

Fix/bug 56326
This commit is contained in:
Julia Radzhabova 2022-04-21 10:50:33 +03:00 committed by GitHub
commit 402af3bb95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -130,6 +130,12 @@ define([
updateSheetsInfo: function() { updateSheetsInfo: function() {
if (this.printSettings.isVisible()) { if (this.printSettings.isVisible()) {
this.updateSettings(this.printSettings); this.updateSettings(this.printSettings);
this.printSettings.cmbSheet.store.each(function (item) {
var sheetIndex = item.get('value');
if (!this._changedProps[sheetIndex]) {
this._changedProps[sheetIndex] = this.api.asc_getPageOptions(sheetIndex, true, true);
}
}, this);
} else { } else {
this.isFillSheets = false; this.isFillSheets = false;
} }
@ -160,9 +166,6 @@ define([
comboSheetsChange: function(panel, combo, record) { comboSheetsChange: function(panel, combo, record) {
var currentSheet = record.value; var currentSheet = record.value;
this.fillPageOptions(panel, this._changedProps[currentSheet] ? this._changedProps[currentSheet] : this.api.asc_getPageOptions(currentSheet, true), currentSheet); this.fillPageOptions(panel, this._changedProps[currentSheet] ? this._changedProps[currentSheet] : this.api.asc_getPageOptions(currentSheet, true), currentSheet);
if (!this._changedProps[currentSheet]) {
this._changedProps[currentSheet] = this.getPageOptions(this.printSettings, currentSheet);
}
}, },
fillPageOptions: function(panel, props, sheet) { fillPageOptions: function(panel, props, sheet) {
@ -318,6 +321,7 @@ define([
}, },
onShowMainSettingsPrint: function() { onShowMainSettingsPrint: function() {
var me = this;
this._changedProps = []; this._changedProps = [];
this.printSettings.$previewBox.removeClass('hidden'); this.printSettings.$previewBox.removeClass('hidden');
@ -325,6 +329,11 @@ define([
this.isFillSheets = true; this.isFillSheets = true;
this.updateSettings(this.printSettings); this.updateSettings(this.printSettings);
} }
this.printSettings.cmbSheet.store.each(function (item) {
var sheetIndex = item.get('value');
me._changedProps[sheetIndex] = me.api.asc_getPageOptions(sheetIndex, true, true);
}, this);
this.adjPrintParams.asc_setPageOptionsMap(this._changedProps);
this.fillPrintOptions(this.adjPrintParams, false); this.fillPrintOptions(this.adjPrintParams, false);