[SSE] Scale Dialog (set disabled)
This commit is contained in:
parent
580b80a232
commit
5a51a8d85f
|
@ -56,6 +56,11 @@ define([
|
||||||
title: this.textTitle
|
title: this.textTitle
|
||||||
}, options || {});
|
}, options || {});
|
||||||
|
|
||||||
|
this._state = {
|
||||||
|
width: 'Auto',
|
||||||
|
height: 'Auto'
|
||||||
|
};
|
||||||
|
|
||||||
this.template = [
|
this.template = [
|
||||||
'<div class="box">',
|
'<div class="box">',
|
||||||
'<table style="width: 100%;"><tbody>',
|
'<table style="width: 100%;"><tbody>',
|
||||||
|
@ -99,6 +104,10 @@ define([
|
||||||
minValue : 1,
|
minValue : 1,
|
||||||
allowAuto : true
|
allowAuto : true
|
||||||
});
|
});
|
||||||
|
this.spnScaleWidth.on('change', _.bind(function (field) {
|
||||||
|
this._state.width = field.getValue();
|
||||||
|
this.setDisabledScale();
|
||||||
|
}, this));
|
||||||
|
|
||||||
this.spnScaleHeight = new Common.UI.MetricSpinner({
|
this.spnScaleHeight = new Common.UI.MetricSpinner({
|
||||||
el : $('#scale-height'),
|
el : $('#scale-height'),
|
||||||
|
@ -110,6 +119,10 @@ define([
|
||||||
minValue : 1,
|
minValue : 1,
|
||||||
allowAuto : true
|
allowAuto : true
|
||||||
});
|
});
|
||||||
|
this.spnScaleHeight.on('change', _.bind(function (field) {
|
||||||
|
this._state.height = field.getValue();
|
||||||
|
this.setDisabledScale();
|
||||||
|
}, this));
|
||||||
|
|
||||||
this.spnScale = new Common.UI.MetricSpinner({
|
this.spnScale = new Common.UI.MetricSpinner({
|
||||||
el : $('#scale'),
|
el : $('#scale'),
|
||||||
|
@ -138,6 +151,15 @@ define([
|
||||||
this._handleInput(event.currentTarget.attributes['result'].value);
|
this._handleInput(event.currentTarget.attributes['result'].value);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setDisabledScale: function() {
|
||||||
|
if (this._state.height !== 'Auto' || this._state.width !== 'Auto') {
|
||||||
|
this.spnScale.setValue('100 %');
|
||||||
|
this.spnScale.setDisabled(true);
|
||||||
|
} else {
|
||||||
|
this.spnScale.setDisabled(false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
textTitle: 'Scale Settings',
|
textTitle: 'Scale Settings',
|
||||||
cancelButtonText: 'Cancel',
|
cancelButtonText: 'Cancel',
|
||||||
okButtonText: 'Ok',
|
okButtonText: 'Ok',
|
||||||
|
|
Loading…
Reference in a new issue