Ignore:
Timestamp:
03/09/14 14:23:42 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Enable/disable buttons on content change.
  • One place to do date formatting, because it was going wrong again.
  • Serialize questions in survey properly.
  • _ComplexValueMixin consumes submit events, but does trigger outer forms if present.
  • Trigger dialog show/hide for login only after previous effect is finished.
  • Check that documents are actually valid, not just that validator returned a result.
  • Validate email and timestamp formats.
  • Prepared for live runs.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/pages/surveyRun.js

    r490 r492  
    7474        },
    7575        _onPropChange: function(e) {
    76             if ( this.surveyRunWidget.validate() ) {
    77                 lang.mixin(this.object,this.surveyRunWidget.get('value'));
     76            if ( this._updateObject() ) {
    7877                this._refreshURL();
    7978            }
     
    9089        },
    9190        _save: function() {
    92             if ( this.surveyRunWidget.validate() ) {
    93                 lang.mixin(this.object,this.surveyRunWidget.get('value'));
     91            if ( this._updateObject() ) {
    9492                return this.inherited(arguments);
    9593            } else {
    9694                return new Deferred.reject();
    9795            }
     96        },
     97        _updateObject: function() {
     98            var valid = this.surveyRunWidget.validate();
     99            if ( valid ) {
     100                lang.mixin(this.object,this.surveyRunWidget.get('value'));
     101            }
     102            return valid;
    98103        },
    99104        _onSave: function(evt) {
     
    115120            if ( evt ) { event.stop(evt); }
    116121            return false;
     122        },
     123        markDirty: function() {
     124            this.saveBtn.set('disabled',false);
     125            this.saveAndCloseBtn.set('disabled',false);
     126            this.discardBtn.set('label','Discard & Close');
     127            this.inherited(arguments);
     128        },
     129        markClean: function() {
     130            this.saveBtn.set('disabled',true);
     131            this.saveAndCloseBtn.set('disabled',true);
     132            this.discardBtn.set('label','Close');
     133            this.inherited(arguments);
    117134        }
    118135    });
Note: See TracChangeset for help on using the changeset viewer.