Changeset 493 for Dev/trunk/src/client/qed-client/pages
- Timestamp:
- 03/09/14 19:25:40 (11 years ago)
- Location:
- Dev/trunk/src/client/qed-client/pages
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/pages/question.js
r492 r493 25 25 _refresh: function() { 26 26 this.titleNode.innerHTML = this.object.title || ""; 27 this.propertiesForm.set('value',this.object );28 this.contentList.set('value',this.object.content );27 this.propertiesForm.set('value',this.object,null); 28 this.contentList.set('value',this.object.content,null); 29 29 }, 30 30 _handlePropertiesChange: function() { 31 lang.mixin(this.object,this.propertiesForm.get('value'));31 this._updateObject(); 32 32 this.markDirty(); 33 33 this._refresh(); 34 34 }, 35 35 _handleContentChange: function() { 36 this. object.content = this.contentList.get('value');36 this._updateObject(); 37 37 this.markDirty(); 38 38 this._refresh(); 39 39 }, 40 _updateObject: function() { 41 var pValid = this.propertiesForm.validate(); 42 if ( pValid ) { 43 lang.mixin(this.object,this.propertiesForm.get('value')); 44 } 45 var cValid = this.contentList.validate(); 46 if ( cValid ) { 47 this.object.content = this.contentList.get('value'); 48 } 49 this._isValid = pValid && cValid; 50 return this._isValid; 51 }, 40 52 _save: function() { 41 if ( this._ isValid) {53 if ( this._updateObject() ) { 42 54 return this.inherited(arguments); 43 55 } else { … … 65 77 }, 66 78 markDirty: function() { 67 this._isValid = this.propertiesForm.validate() &&68 this.contentList.validate();69 79 this.saveBtn.set('disabled',!this._isValid); 70 80 this.saveAndCloseBtn.set('disabled',!this._isValid); … … 73 83 }, 74 84 markClean: function() { 75 this._isValid = true;76 85 this.saveBtn.set('disabled',true); 77 86 this.saveAndCloseBtn.set('disabled',true); -
Dev/trunk/src/client/qed-client/pages/survey.js
r492 r493 59 59 _refresh: function() { 60 60 this.titleNode.innerHTML = this.object.title || "(set title in properties)"; 61 this.propertiesForm.set('value',{survey:this.object}); 62 this.questionList.set('value', 63 this.object.questions); 61 this.propertiesForm.set('value',{survey:this.object},null); 62 this.questionList.set('value',this.object.questions,null); 64 63 }, 65 64 _includeQuestion: function(question) { -
Dev/trunk/src/client/qed-client/pages/surveyRun.js
r492 r493 22 22 templateString: template, 23 23 classStore: surveyRuns, 24 _isValid: false, 24 25 startup: function() { 25 26 if ( this._started ) { return; } … … 30 31 _refresh: function() { 31 32 this.titleNode.innerHTML = this.object.title || ""; 32 this.surveySummaryWidget.set('value',this.object.survey );33 this.surveyRunWidget.set('value',this.object );33 this.surveySummaryWidget.set('value',this.object.survey,null); 34 this.surveyRunWidget.set('value',this.object,null); 34 35 this._refreshURL(); 35 36 this._loadResponses(); … … 96 97 }, 97 98 _updateObject: function() { 98 var valid = this.surveyRunWidget.validate();99 if ( valid ) {99 this._isValid = this.surveyRunWidget.validate(); 100 if ( this._isValid ) { 100 101 lang.mixin(this.object,this.surveyRunWidget.get('value')); 101 102 } 102 return valid;103 return this._isValid; 103 104 }, 104 105 _onSave: function(evt) { … … 122 123 }, 123 124 markDirty: function() { 124 this.saveBtn.set('disabled', false);125 this.saveAndCloseBtn.set('disabled', false);125 this.saveBtn.set('disabled',!this._isValid); 126 this.saveAndCloseBtn.set('disabled',!this._isValid); 126 127 this.discardBtn.set('label','Discard & Close'); 127 128 this.inherited(arguments);
Note: See TracChangeset
for help on using the changeset viewer.