Changeset 512 for Dev/trunk/src/client/qed-client/pages/survey.js
- Timestamp:
- 03/13/14 01:19:07 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/pages/survey.js
r503 r512 5 5 "../model/widgets/TabbedQuestionBrowser", 6 6 "./_ObjectPage", 7 "dojo/Deferred", 7 8 "dojo/_base/array", 8 9 "dojo/_base/declare", … … 12 13 "require", 13 14 "dojo/text!./templates/survey.html" 14 ], function(Router, surveys, QuestionListView, TabbedQuestionBrowser, _ObjectPage, array, declare, event, lang, when, require, template) {15 ], function(Router, surveys, QuestionListView, TabbedQuestionBrowser, _ObjectPage, Deferred, array, declare, event, lang, when, require, template) { 15 16 return declare([_ObjectPage],{ 16 17 contextRequire: require, … … 77 78 }, 78 79 _handleQuestionsChange: function() { 79 this. object.questions = this.questionList.get('value');80 this._updateObject(); 80 81 this.markDirty(); 81 82 this._refresh(); 82 83 }, 83 84 _handlePropertiesChange: function() { 84 lang.mixin(this.object, this.propertiesForm.get('value').survey);85 this._updateObject(); 85 86 this.markDirty(); 86 87 this._refresh(); 87 88 this.layout(); 89 }, 90 _updateObject: function() { 91 this._isValid = this.propertiesForm.validate(); 92 lang.mixin(this.object, this.propertiesForm.get('value').survey); 93 this.object.questions = this.questionList.get('value'); 94 return this._isValid; 88 95 }, 89 96 _onSave: function(evt) { … … 109 116 }); 110 117 }, 118 _save: function() { 119 if ( this._updateObject ) { 120 return this.inherited(arguments); 121 } else { 122 return new Deferred().reject({error:"Please correct invalid values."}); 123 } 124 }, 111 125 markDirty: function() { 112 this.saveBtn.set('disabled', false);113 this.saveAndCloseBtn.set('disabled', false);126 this.saveBtn.set('disabled',!this._isValid); 127 this.saveAndCloseBtn.set('disabled',!this._isValid); 114 128 this.discardBtn.set('label','Discard & Close'); 115 129 this.inherited(arguments);
Note: See TracChangeset
for help on using the changeset viewer.