- Timestamp:
- 03/12/14 02:23:11 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/model/widgets/questions/NumberInputWidget.js
r443 r508 1 1 define([ 2 "../../../widgets/_ComplexValueWidget", 2 "dijit/_Container", 3 "dijit/_TemplatedMixin", 4 "dijit/_WidgetBase", 5 "dijit/_WidgetsInTemplateMixin", 3 6 "dojo/_base/declare", 4 7 "dojo/text!./templates/NumberInputWidget.html" 5 ], function(_ComplexValueWidget, declare, template) { 6 return declare([_ComplexValueWidget],{ 8 ], function(_Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, declare, template) { 9 return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{ 10 templateString: template, 7 11 text: '', 8 maxLength: null,9 templateString: template,10 12 startup: function() { 13 if ( this._started ) { return; } 14 this.inherited(arguments); 15 11 16 var constraints = {}; 12 if ( this.min !== null&& !isNaN(this.min) ) {17 if ( this.min && !isNaN(this.min) ) { 13 18 constraints.min = this.min; 14 19 } 15 if ( this.max !== null&& !isNaN(this.max) ) {20 if ( this.max && !isNaN(this.max) ) { 16 21 constraints.max = this.max; 17 22 } 18 if ( this.places !== null&& !isNaN(this.places) ) {23 if ( this.places && !isNaN(this.places) ) { 19 24 constraints.places = this.places; 20 25 } 21 26 this.numberBox.set('constraints', constraints); 22 },23 _getValueAttr: function() {24 return this.numberBox.get('value');25 },26 _setValueAttr: function(value) {27 return this.numberBox.set('value', value);28 27 } 29 28 });
Note: See TracChangeset
for help on using the changeset viewer.