Merge pull request #244 from ONLYOFFICE/feature/new-settings
Feature/new settings
This commit is contained in:
commit
be8286ea67
|
@ -3417,7 +3417,6 @@ define([
|
||||||
} else if (scale < 10) {
|
} else if (scale < 10) {
|
||||||
scale = 10;
|
scale = 10;
|
||||||
}
|
}
|
||||||
this.api.asc_SetPrintScale(0, 0, scale);
|
|
||||||
this.onChangeScaleSettings(0, 0, scale);
|
this.onChangeScaleSettings(0, 0, scale);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -129,15 +129,9 @@ define([
|
||||||
editable: true,
|
editable: true,
|
||||||
data: this.arrDataScale,
|
data: this.arrDataScale,
|
||||||
scrollAlwaysVisible: true
|
scrollAlwaysVisible: true
|
||||||
}).on('selected', _.bind(function (field) {
|
}).on('selected', _.bind(this.changeWidthHeight, this, 'width'))
|
||||||
this._state.width = field.getValue();
|
.on('changed:after', _.bind(this.changeWidthHeight, this, 'width'))
|
||||||
if ((this._state.width === 0 || this._state.width === null) && (this._state.height === 0 || this._state.height === null)) {
|
.on('changed:before', _.bind(this.onChangeComboScale, this, 'width'));
|
||||||
this.radioScaleTo.setValue(true, true);
|
|
||||||
} else {
|
|
||||||
this.radioFitTo.setValue(true, true);
|
|
||||||
}
|
|
||||||
}, this))
|
|
||||||
.on('changed:before', _.bind(this.onChangeComboScale, this, 'width'));
|
|
||||||
|
|
||||||
this.cmbScaleHeight = new Common.UI.ComboBox({
|
this.cmbScaleHeight = new Common.UI.ComboBox({
|
||||||
el: $('#scale-height'),
|
el: $('#scale-height'),
|
||||||
|
@ -147,15 +141,9 @@ define([
|
||||||
editable: true,
|
editable: true,
|
||||||
data: this.arrDataScale,
|
data: this.arrDataScale,
|
||||||
scrollAlwaysVisible: true
|
scrollAlwaysVisible: true
|
||||||
}).on('selected', _.bind(function (field) {
|
}).on('selected', _.bind(this.changeWidthHeight, this, 'height'))
|
||||||
this._state.height = field.getValue();
|
.on('changed:after', _.bind(this.changeWidthHeight, this, 'height'))
|
||||||
if ((this._state.width === 0 || this._state.width === null) && (this._state.height === 0 || this._state.height === null)) {
|
.on('changed:before', _.bind(this.onChangeComboScale, this, 'height'));
|
||||||
this.radioScaleTo.setValue(true, true);
|
|
||||||
} else {
|
|
||||||
this.radioFitTo.setValue(true, true);
|
|
||||||
}
|
|
||||||
}, this))
|
|
||||||
.on('changed:before', _.bind(this.onChangeComboScale, this, 'height'));
|
|
||||||
|
|
||||||
this.spnScale = new Common.UI.MetricSpinner({
|
this.spnScale = new Common.UI.MetricSpinner({
|
||||||
el : $('#scale'),
|
el : $('#scale'),
|
||||||
|
@ -199,6 +187,26 @@ define([
|
||||||
return false;
|
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) {
|
onRadioScale: function(type, field, newValue) {
|
||||||
if (type === 'scaleto') {
|
if (type === 'scaleto') {
|
||||||
this.cmbScaleHeight.setValue(0,true);
|
this.cmbScaleHeight.setValue(0,true);
|
||||||
|
|
Loading…
Reference in a new issue