Changeset 457 for Dev/trunk/src/client/qed-client/pages/surveyRun.js
- Timestamp:
- 06/09/13 17:27:20 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/pages/surveyRun.js
r443 r457 21 21 if ( this._started ) { return; } 22 22 this.inherited(arguments); 23 this. propertiesForm.on("blur",lang.hitch(this,'_onPropChange'));23 this.surveyRunWidget.on("blur",lang.hitch(this,'_onPropChange')); 24 24 if ( this.surveyRunId ) { 25 25 this._loadSurveyRun(); … … 38 38 refreshSurveyRun: function() { 39 39 this.titleNode.innerHTML = SurveyRun.DisplayTitle.get(this.surveyRun); 40 this.survey Node.set('value',SurveyRun.Survey.get(this.surveyRun));41 this. propertiesForm.set('value',this.surveyRun);40 this.surveySummaryWidget.set('value',SurveyRun.Survey.get(this.surveyRun)); 41 this.surveyRunWidget.set('value',this.surveyRun); 42 42 this._onPropChange(); 43 43 }, … … 70 70 }, 71 71 _onPropChange: function(e) { 72 var surveyRun = this. propertiesForm.get('value');72 var surveyRun = this.surveyRunWidget.get('value'); 73 73 if ( surveyRun.mode === "open" ) { 74 74 this.runURLNode.innerHTML = this._link(this._getGeneralURL(store.getIdentity(this.surveyRun))); … … 87 87 }, 88 88 _onSave: function(evt) { 89 lang.mixin(this.surveyRun,this.propertiesForm.get('value')); 90 var not = function(p){ return !p; }; 91 func.modPropIf(this.surveyRun,"startDate",not.compose(lang.isString),store.formatDate); 92 func.modPropIf(this.surveyRun,"endDate",not.compose(lang.isString),store.formatDate); 93 store.put(this.surveyRun) 94 .then(function() { 95 Router.go('/surveys'); 96 },function(err){ 97 Content.notify(err); 98 }); 89 if ( this.surveyRunWidget.validate() ) { 90 lang.mixin(this.surveyRun,this.surveyRunWidget.get('value')); 91 92 var SD = SurveyRun.StartDate; 93 var ED = SurveyRun.EndDate; 94 SD.set(this.surveyRun, SD.get(this.surveyRun)); 95 ED.set(this.surveyRun, ED.get(this.surveyRun)); 96 97 store.put(this.surveyRun) 98 .then(function() { 99 Router.go('/surveys'); 100 },function(err){ 101 Content.notify(err); 102 }); 103 } 99 104 event.stop(evt); 100 105 return false;
Note: See TracChangeset
for help on using the changeset viewer.