Ignore:
Timestamp:
03/12/14 02:23:11 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Server handles the new flat response format correctly.
  • Client widgets and survey rendering creates a flat structure.
  • Fixed logic error in checking if questions in survey are published.
  • Restrict accepted properties in answers and reject empty strings as properties.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/model/widgets/questions/NumberInputWidget.js

    r443 r508  
    11define([
    2     "../../../widgets/_ComplexValueWidget",
     2    "dijit/_Container",
     3    "dijit/_TemplatedMixin",
     4    "dijit/_WidgetBase",
     5    "dijit/_WidgetsInTemplateMixin",
    36    "dojo/_base/declare",
    47    "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,
    711        text: '',
    8         maxLength: null,
    9         templateString: template,
    1012        startup: function() {
     13            if ( this._started ) { return; }
     14            this.inherited(arguments);
     15
    1116            var constraints = {};
    12             if ( this.min !== null && !isNaN(this.min) ) {
     17            if ( this.min && !isNaN(this.min) ) {
    1318                constraints.min = this.min;
    1419            }
    15             if ( this.max !== null && !isNaN(this.max) ) {
     20            if ( this.max && !isNaN(this.max) ) {
    1621                constraints.max = this.max;
    1722            }
    18             if ( this.places !== null && !isNaN(this.places) ) {
     23            if ( this.places && !isNaN(this.places) ) {
    1924                constraints.places = this.places;
    2025            }
    2126            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);
    2827        }
    2928    });
Note: See TracChangeset for help on using the changeset viewer.