Changeset 478 for Dev/trunk/src/client/qed-client/pages
- Timestamp:
- 10/16/13 16:05:39 (12 years ago)
- Location:
- Dev/trunk/src/client/qed-client/pages
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/pages/response.js
r477 r478 63 63 this.submitButton.set('disabled',false); 64 64 this.continueButton.set('disabled',false); 65 this.cancelButton.set('disabled',false); 65 66 this.surveyWidget.set('disabled', false); 66 67 }, … … 68 69 this.submitButton.set('disabled',true); 69 70 this.continueButton.set('disabled',true); 71 this.cancelButton.set('disabled',true); 70 72 this.surveyWidget.set('disabled', true); 71 73 }, … … 80 82 data:json.toJson(this.response), 81 83 headers:{"Content-Type": "application/json"} 82 }).then(function(){ 84 }).then(lang.hitch(this,function(res){ 85 this.response._rev = res.rev; 83 86 Content.notify("Your response is saved."); 84 } , function(err){87 }), function(err){ 85 88 Content.notify(err,'error'); 86 89 }); … … 104 107 return false; 105 108 }, 109 _onCancel: function(e) { 110 this._disableSubmit(); 111 this.surveyWidget.destroy(); 112 request('/api/responses/'+store.getIdentity(this.response)+'?rev='+store.getRevision(this.response),{ 113 method: 'DELETE', 114 handleAs:'json', 115 data:json.toJson(this.response), 116 headers:{"Content-Type": "application/json"} 117 }).then(lang.hitch(this,function(res){ 118 this._showInfo("<div>Your response has been deleted, no answers have been saved.</div>"); 119 Content.notify("Your response is deleted."); 120 }), function(err){ 121 Content.notify(err,'error'); 122 }); 123 if ( e ) { event.stop(e); } 124 return false; 125 }, 106 126 _ignoreEvent: function(e) { 107 127 if ( e ) { event.stop(e); } -
Dev/trunk/src/client/qed-client/pages/templates/response.html
r463 r478 29 29 data-dojo-attach-point="continueButton" 30 30 data-dojo-attach-event="onClick:_onContinueLater"> 31 Continue later</button> 31 Save & Continue later</button> 32 <button data-dojo-type="dijit/form/Button" 33 type="button" 34 data-dojo-attach-point="cancelButton" 35 data-dojo-attach-event="onClick:_onCancel"> 36 Cancel & Delete</button> 32 37 </div> 33 38
Note: See TracChangeset
for help on using the changeset viewer.