Changeset 529 for Dev/trunk/src/client/qed-client/pages/surveys.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/surveys.js
r508 r529 16 16 if ( this._started ) { return; } 17 17 this.inherited(arguments); 18 this.draftsTab.set('title','Drafts (<span class="qedLoading"></span>)'); 19 this.publishedTab.set('title','Published (<span class="qedLoading"></span>)'); 20 this.runsTab.set('title','Runs (<span class="qedLoading"></span>)'); 18 21 this.refresh(); 19 22 }, … … 22 25 }, 23 26 _onPublishSurvey:function(survey){ 24 var self = this; 27 if ( !confirm("After publication the survey cannot be modified anymore, are you sure?") ) { 28 return; 29 } 25 30 survey.publicationDate = new Date(); 26 31 surveys.save(survey) 27 .then( function(){28 self.refreshDrafts();29 self.refreshPublished();30 } ,lang.hitch(this,function(err){32 .then(lang.hitch(this,function(){ 33 this.refreshDrafts(); 34 this.refreshPublished(); 35 }),lang.hitch(this,function(err){ 31 36 this.notify(err.error,'error'); 32 37 })); 33 38 }, 34 39 _onDeleteSurvey:function(survey){ 35 var self = this; 40 if ( !confirm("Are you sure you want to delete this draft survey?") ) { 41 return; 42 } 36 43 surveys.remove(survey) 37 .then( function(){38 self.refreshDrafts();39 } ,lang.hitch(this,function(err){44 .then(lang.hitch(this,function(){ 45 this.refreshDrafts(); 46 }),lang.hitch(this,function(err){ 40 47 this.notify(err.error,'error'); 41 48 })); … … 62 69 }, 63 70 _onRunDelete: function(surveyRun) { 71 if ( !confirm("Are you sure you want to delete this survey run?") ) { 72 return; 73 } 64 74 surveyRuns.remove(surveyRun) 65 75 .then(lang.hitch(this,function(){ … … 135 145 label: 'Run', 136 146 tooltip: 'Run survey', 137 icon: ' Run'147 icon: 'Forward' 138 148 } 139 149 }]
Note: See TracChangeset
for help on using the changeset viewer.