Changeset 493 for Dev/trunk/src/client/qed-client/pages/question.js
- Timestamp:
- 03/09/14 19:25:40 (11 years ago)
- File:
-
- 1 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);
Note: See TracChangeset
for help on using the changeset viewer.