Changeset 490 for Dev/trunk/src/client/qed-client/pages/surveys.js
- Timestamp:
- 03/08/14 22:51:23 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/pages/surveys.js
r487 r490 1 1 define([ 2 "../app/Content",3 2 "../app/Page", 4 3 "../app/Router", 4 "../model/classes/surveyRuns", 5 5 "../model/classes/surveys", 6 "../model/classes/surveyRuns",7 6 "../widgets/LineWithActionsWidget", 8 7 "dojo/_base/array", … … 11 10 "dojo/when", 12 11 "dojo/text!./templates/surveys.html" 13 ], function( Content, Page, Router, surveys, surveyRuns, LineWithActionsWidget, array, declare, lang, when, template) {12 ], function(Page, Router, surveyRuns, surveys, LineWithActionsWidget, array, declare, lang, when, template) { 14 13 return declare([Page],{ 15 14 templateString: template, … … 20 19 }, 21 20 _onNewSurvey: function(){ 22 Router.go( '/survey/new');21 Router.go(surveys.getObjectPath('new')); 23 22 }, 24 23 _onPublishSurvey:function(survey){ … … 29 28 self.refreshDrafts(); 30 29 self.refreshPublished(); 31 }, function(err){32 Content.notify(err,'error');33 }) ;30 },lang.hitch(this,function(err){ 31 this.notify(err.error,'error'); 32 })); 34 33 }, 35 34 _onDeleteSurvey:function(survey){ … … 38 37 .then(function(){ 39 38 self.refreshDrafts(); 40 }, function(err){41 Content.notify(err,'error');42 }) ;39 },lang.hitch(this,function(err){ 40 this.notify(err.error,'error'); 41 })); 43 42 }, 44 43 _onEditSurvey:function(survey){ 45 Router.go( '/survey/'+survey._id);44 Router.go(surveys.getObjectPath(survey)); 46 45 }, 47 46 _onPreviewSurvey:function(survey){ 48 Router.go( '/previewSurvey/'+survey._id);47 Router.go(surveys.getPreviewPath(survey)); 49 48 }, 50 49 _onRunSurvey:function(survey){ … … 54 53 .then(lang.hitch(this,function(surveyRun){ 55 54 this._onRunDetails(surveyRun); 56 }), function(err){57 Content.notify(err);58 }) ;55 }),lang.hitch(this,function(err){ 56 this.notify(err.error,'error'); 57 })); 59 58 }, 60 59 _onRunDetails: function(surveyRun) { 61 Router.go( '/surveyRun/'+surveyRun._id);60 Router.go(surveyRuns.getObjectPath(surveyRun)); 62 61 }, 63 62 refresh: function() {
Note: See TracChangeset
for help on using the changeset viewer.