Changeset 500 for Dev/trunk/src/client/qed-client/pages
- Timestamp:
- 03/10/14 16:07:00 (11 years ago)
- Location:
- Dev/trunk/src/client/qed-client/pages
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/pages/_ObjectPage.js
r492 r500 22 22 _load: function() { 23 23 if ( this.object ) { 24 this._refresh( );24 this._refresh(true); 25 25 } else if ( this.objectId ) { 26 26 if ( this.objectId === "new" ) { 27 27 this.object = this.classStore.create(); 28 this._refresh(); 28 this.markDirty(); 29 this._refresh(true); 29 30 } else { 30 31 this.classStore.load(this.objectId) 31 .then(lang.hitch(this,'_setObject'), 32 lang.hitch(this,function(err){ 33 this.die(err.error); 34 })); 32 .then(lang.hitch(this,function(object){ 33 this._setObject(object,true); 34 }),lang.hitch(this,function(err){ 35 this.die(err.error); 36 })); 35 37 } 36 38 } else { 37 this.die("No valid uid or object passed!");39 this.die("No valid id or object passed!"); 38 40 } 39 41 }, 40 _setObject: function(object ) {42 _setObject: function(object,initial) { 41 43 this.object = object; 42 44 if ( this.objectId === "new" ) { 43 45 this.go(this.classStore.getObjectPath(this.object),{},true); 44 46 } 45 this._refresh(); 47 this.markClean(); 48 this._refresh(initial); 46 49 }, 47 _refresh: function( ) {},50 _refresh: function(initial) {}, 48 51 _save: function() { 49 52 return this.classStore.save(this.object) 50 53 .then(lang.hitch(this,function(object){ 51 this.markClean();52 54 this._setObject(object); 53 55 this.notify(this.classStore.getName()+" successfully saved."); -
Dev/trunk/src/client/qed-client/pages/question.js
r498 r500 23 23 this._load(); 24 24 }, 25 _refresh: function() { 26 this.propertiesForm.set('value',this.object,null); 27 this.contentList.set('value',this.object.content,null); 28 this._internalRefresh(); 29 }, 30 _internalRefresh: function(){ 25 _refresh: function(initial) { 26 if ( initial === true ) { 27 this.propertiesForm.set('value',this.object,null); 28 this.contentList.set('value',this.object.content,null); 29 } 31 30 this.titleNode.innerHTML = this.object.title || ""; 32 31 }, … … 34 33 this._updateObject(); 35 34 this.markDirty(); 36 this._ internalRefresh();35 this._refresh(); 37 36 }, 38 37 _handleContentChange: function() { 39 38 this._updateObject(); 40 39 this.markDirty(); 41 this._ internalRefresh();40 this._refresh(); 42 41 }, 43 42 _updateObject: function() { -
Dev/trunk/src/client/qed-client/pages/survey.js
r498 r500 61 61 this.questionList.startup(); 62 62 }, 63 _refresh: function() { 64 this.propertiesForm.set('value',{survey:this.object},null); 65 this.questionList.set('value',this.object.questions,null); 66 this._internalRefresh(); 67 }, 68 _internalRefresh: function() { 63 _refresh: function(initial) { 64 if ( initial === true ) { 65 this.propertiesForm.set('value',{survey:this.object},null); 66 this.questionList.set('value',this.object.questions,null); 67 } 69 68 this.titleNode.innerHTML = this.object.title || "(set title in properties)"; 70 69 }, … … 75 74 this.object.questions = this.questionList.get('value'); 76 75 this.markDirty(); 77 this._ internalRefresh();76 this._refresh(); 78 77 }, 79 78 _onShowProperties: function(evt) { … … 86 85 lang.mixin(this.object, this.propertiesForm.get('value').survey); 87 86 this.markDirty(); 88 this._ internalRefresh();87 this._refresh(); 89 88 if ( evt ) { event.stop(evt); } 90 89 return false; -
Dev/trunk/src/client/qed-client/pages/surveyRun.js
r498 r500 29 29 this._load(); 30 30 }, 31 _refresh: function() { 32 this.surveySummaryWidget.set('value',this.object.survey,null); 33 this.surveyRunWidget.set('value',this.object,null); 34 this._internalRefresh(); 35 this._loadResponses(); 36 }, 37 _internalRefresh: function() { 31 _refresh: function(initial) { 32 if ( initial === true ) { 33 this.surveySummaryWidget.set('value',this.object.survey,null); 34 this.surveyRunWidget.set('value',this.object,null); 35 this._loadResponses(); 36 } 38 37 this.titleNode.innerHTML = this.object.title || ""; 39 38 if ( this.object.mode === "open" ) { … … 77 76 this._updateObject(); 78 77 this.markDirty(); 79 this._ internalRefresh();78 this._refresh(); 80 79 }, 81 80 _buildGeneralURL: function(surveyRun) {
Note: See TracChangeset
for help on using the changeset viewer.