Changeset 529 for Dev/trunk/src/client/qed-client/pages/surveyRun.js
- Timestamp:
- 03/23/14 22:58:54 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/pages/surveyRun.js
r519 r529 47 47 .then(lang.hitch(this,function(allResponses){ 48 48 array.forEach(allResponses, function(response){ 49 var actions = {} ;49 var actions = {}, w; 50 50 if ( !response.publicationDate ) { 51 51 actions.Delete = { 52 callback: function(){ 53 responses.remove(response) 54 .then(function(){ 55 w.destroy(); 56 }); 57 }, 52 callback: lang.hitch(this,function(){ 53 // We cannot bind _onDeleteResponse 54 // directly, because of the 55 // initialization problem with w. We 56 // need it in the handler, but we need 57 // to pass the handler as an argument 58 // on the creation of w. 59 this._onDeleteResponse(response,w); 60 }), 58 61 properties: { 59 62 icon: 'Delete', … … 62 65 }; 63 66 } 64 varw = new LineWithActionsWidget({67 w = new LineWithActionsWidget({ 65 68 actions: actions 66 69 }); … … 70 73 }, this); 71 74 })); 75 }, 76 _onDeleteResponse: function(response,w) { 77 if ( !confirm("Are you sure you want to delete this survey response?") ) { 78 return; 79 } 80 responses.remove(response) 81 .then(function(){ 82 w.destroy(); 83 }); 72 84 }, 73 85 _handlePropChange: function(e) {
Note: See TracChangeset
for help on using the changeset viewer.