Changeset 492 for Dev/trunk/src/client/qed-client/pages/survey.js
- Timestamp:
- 03/09/14 14:23:42 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/pages/survey.js
r491 r492 23 23 this._setupQuestionBrowser(); 24 24 this._setupListView(); 25 this.questionList.on('change',lang.hitch(this,'_handleQuestionsChange')); 25 26 this._load(); 26 27 }, … … 58 59 _refresh: function() { 59 60 this.titleNode.innerHTML = this.object.title || "(set title in properties)"; 60 this.properties Dialog.set('value',{survey:this.object});61 this.propertiesForm.set('value',{survey:this.object}); 61 62 this.questionList.set('value', 62 63 this.object.questions); 63 64 }, 64 _save: function() {65 this.object.questions = this.questionList.get('value');66 return this.inherited(arguments);67 },68 65 _includeQuestion: function(question) { 69 66 this.questionList.appendItem(question); 67 }, 68 _handleQuestionsChange: function() { 69 this.object.questions = this.questionList.get('value'); 70 this.markDirty(); 71 this._refresh(); 70 72 }, 71 73 _onShowProperties: function(evt) { … … 76 78 _onPropertiesOk: function(evt) { 77 79 this.propertiesDialog.hide(); 78 lang.mixin(this.object, this.properties Dialog.get('value').survey);80 lang.mixin(this.object, this.propertiesForm.get('value').survey); 79 81 this.markDirty(); 80 82 this._refresh(); … … 84 86 _onPropertiesCancel: function(evt) { 85 87 this.propertiesDialog.hide(); 86 this.properties Dialog.set('value',{survey:this.object});88 this.propertiesForm.set('value',{survey:this.object}); 87 89 if ( evt ) { event.stop(evt); } 88 90 return false; … … 109 111 preview: true 110 112 }); 113 }, 114 markDirty: function() { 115 this.saveBtn.set('disabled',false); 116 this.saveAndCloseBtn.set('disabled',false); 117 this.discardBtn.set('label','Discard & Close'); 118 this.inherited(arguments); 119 }, 120 markClean: function() { 121 this.saveBtn.set('disabled',true); 122 this.saveAndCloseBtn.set('disabled',true); 123 this.discardBtn.set('label','Close'); 124 this.inherited(arguments); 111 125 } 112 126 });
Note: See TracChangeset
for help on using the changeset viewer.