Ignore:
Timestamp:
06/18/12 12:51:58 (13 years ago)
Author:
hendrikvanantwerpen
Message:

[Client] Changed store and pages to use CouchDB.
[Client] Disabled login for now, have to figure out some more details about CouchDB.

Location:
Dev/branches/rest-dojo-ui/client/rft/ui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Dev/branches/rest-dojo-ui/client/rft/ui/QuestionWidget.js

    r305 r343  
    99            name: '',
    1010            value: null,
    11             _type: null,
     11            _scale: null,
    1212            _widgetCache: null,
    1313            constructor: function() {
     
    1818            postCreate: function() {
    1919                this._resetValue = this.value;
    20                 this.typeSelector.set('disabled', this.mode == 'edit');
     20                this.scaleSelector.set('disabled', this.mode == 'edit');
    2121            },
    2222            _setValueAttr: function(value) {
    2323                this.value = value;
    24                 this._onTypeChange(value.type || 'string');
     24                this._onTypeChange(value.scale || 'string');
    2525                this.ourForm.set('value',value);
    2626            },
     
    3030                return this.value;
    3131            },
    32             _onTypeChange: function(type) {
    33                 if ( this._type == type ) return;
    34                 this._type = type;
    35                 domConstruct.empty(this.typeDetails);
    36                 var widget = this._getTypeWidget(type);
    37                 widget && widget.placeAt(this.typeDetails,'only');
     32            _onTypeChange: function(scale) {
     33                if ( this._scale == scale ) return;
     34                this._scale = scale;
     35                domConstruct.empty(this.scaleDetails);
     36                var widget = this._getTypeWidget(scale);
     37                widget && widget.placeAt(this.scaleDetails,'only');
    3838            },
    39             _getTypeWidget: function(type) {
    40                 var widget = this._widgetCache[type];
     39            _getTypeWidget: function(scale) {
     40                var widget = this._widgetCache[scale];
    4141                if (!widget) {
    42                     switch(type) {
     42                    switch(scale) {
    4343                        case 'string':
    4444                            widget = new TextBox({
     
    5959                                name: 'answers',
    6060                                mode: this.mode,
    61                                 allowMultiple: type == 'multipleChoice'
     61                                allowMultiple: scale == 'multipleChoice'
    6262                            });
    6363                            break;
    6464                    }
    65                     this._widgetCache[type] = widget;
     65                    this._widgetCache[scale] = widget;
    6666                }
    6767                return widget;
  • Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionWidget.html

    r303 r343  
    1212        </fieldset>
    1313        <fieldset>
    14             <select data-dojo-type="dijit.form.Select" data-dojo-attach-point="typeSelector" data-dojo-attach-event="onChange:_onTypeChange" name="type">
     14            <select data-dojo-type="dijit.form.Select" data-dojo-attach-point="scaleSelector" data-dojo-attach-event="onChange:_onTypeChange" name="scale">
    1515                <option value="string" selected>String</option>
    1616                <option value="text">Text</option>
     
    1818                <option value="multipleChoice">Multiple choice</option>
    1919            </select>
    20             <div data-dojo-attach-point="typeDetails"></div>
     20            <div data-dojo-attach-point="scaleDetails"></div>
    2121        </fieldset>
    2222    </form>
Note: See TracChangeset for help on using the changeset viewer.