diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 656a4cf25..f55de2811 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -3417,7 +3417,6 @@ define([ } else if (scale < 10) { scale = 10; } - this.api.asc_SetPrintScale(0, 0, scale); this.onChangeScaleSettings(0, 0, scale); } }, diff --git a/apps/spreadsheeteditor/main/app/view/ScaleDialog.js b/apps/spreadsheeteditor/main/app/view/ScaleDialog.js index 69d913ce6..34ad019b1 100644 --- a/apps/spreadsheeteditor/main/app/view/ScaleDialog.js +++ b/apps/spreadsheeteditor/main/app/view/ScaleDialog.js @@ -129,15 +129,9 @@ define([ editable: true, data: this.arrDataScale, scrollAlwaysVisible: true - }).on('selected', _.bind(function (field) { - this._state.width = field.getValue(); - if ((this._state.width === 0 || this._state.width === null) && (this._state.height === 0 || this._state.height === null)) { - this.radioScaleTo.setValue(true, true); - } else { - this.radioFitTo.setValue(true, true); - } - }, this)) - .on('changed:before', _.bind(this.onChangeComboScale, this, 'width')); + }).on('selected', _.bind(this.changeWidthHeight, this, 'width')) + .on('changed:after', _.bind(this.changeWidthHeight, this, 'width')) + .on('changed:before', _.bind(this.onChangeComboScale, this, 'width')); this.cmbScaleHeight = new Common.UI.ComboBox({ el: $('#scale-height'), @@ -147,15 +141,9 @@ define([ editable: true, data: this.arrDataScale, scrollAlwaysVisible: true - }).on('selected', _.bind(function (field) { - this._state.height = field.getValue(); - if ((this._state.width === 0 || this._state.width === null) && (this._state.height === 0 || this._state.height === null)) { - this.radioScaleTo.setValue(true, true); - } else { - this.radioFitTo.setValue(true, true); - } - }, this)) - .on('changed:before', _.bind(this.onChangeComboScale, this, 'height')); + }).on('selected', _.bind(this.changeWidthHeight, this, 'height')) + .on('changed:after', _.bind(this.changeWidthHeight, this, 'height')) + .on('changed:before', _.bind(this.onChangeComboScale, this, 'height')); this.spnScale = new Common.UI.MetricSpinner({ el : $('#scale'), @@ -199,6 +187,26 @@ define([ return false; }, + changeWidthHeight: function (type, field) { + var value = field.getValue(); + if (typeof(value) === 'string') { + value = parseInt(value); + if (isNaN(value)) { + value = 0; + } + } + if (type === 'width') { + this._state.width = value; + } else { + this._state.height = value; + } + if ((this._state.width === 0 || this._state.width === null) && (this._state.height === 0 || this._state.height === null)) { + this.radioScaleTo.setValue(true, true); + } else { + this.radioFitTo.setValue(true, true); + } + }, + onRadioScale: function(type, field, newValue) { if (type === 'scaleto') { this.cmbScaleHeight.setValue(0,true);