#42, support for stages in client router and LessonMenuService
This commit is contained in:
@ -39,13 +39,13 @@ define(['jquery',
|
||||
this.start = function() {
|
||||
this.listenTo(this.lessonContent,'contentLoaded',this.onContentLoaded);
|
||||
};
|
||||
|
||||
//load View, which can pull data
|
||||
this.loadLesson = function(scr,menu) {
|
||||
this.loadLesson = function(scr,menu,stage) {
|
||||
this.helpsLoaded = {};
|
||||
this.lessonContent.loadData({
|
||||
'screen': encodeURIComponent(scr),
|
||||
'menu': encodeURIComponent(menu),
|
||||
'screen': scr,
|
||||
'menu': menu,
|
||||
'stage': stage
|
||||
});
|
||||
this.planView = {};
|
||||
this.solutionView = {};
|
||||
|
@ -16,13 +16,14 @@ define(['jquery',
|
||||
initialize: function (options) {
|
||||
this.screenParam = null;
|
||||
this.menuParam = null;
|
||||
this.stageParam = null;
|
||||
this.baseUrlRoot = 'attack?Screen=';
|
||||
},
|
||||
loadData: function(options) {
|
||||
this.urlRoot = this.baseUrlRoot +options.screen + '&menu=' + options.menu;
|
||||
this.urlRoot = this.baseUrlRoot +options.screen + '&menu=' + options.menu + '&stage=' + options.stage;
|
||||
this.set('menuParam',options.menu);
|
||||
this.set('screenParam',options.screen);
|
||||
|
||||
this.set('stageParam',options.stage)
|
||||
var self=this;
|
||||
this.fetch().then(function(data) {
|
||||
self.setContent(data);
|
||||
|
@ -16,7 +16,7 @@ define(['jquery',
|
||||
routes: {
|
||||
//#....
|
||||
'welcome':'welcomeRoute',
|
||||
'attack/:scr/:menu':'attackRoute' //
|
||||
'attack/:scr/:menu(/:stage)':'attackRoute' //
|
||||
},
|
||||
|
||||
lessonController: new LessonController({
|
||||
@ -33,8 +33,8 @@ define(['jquery',
|
||||
this.lessonController.start();
|
||||
this.menuController.initMenu();
|
||||
|
||||
goatRouter.on('route:attackRoute', function(scr,menu) {
|
||||
this.lessonController.loadLesson(scr,menu);
|
||||
goatRouter.on('route:attackRoute', function(scr,menu,stage) {
|
||||
this.lessonController.loadLesson(scr,menu,stage);
|
||||
this.menuController.updateMenu(scr,menu);
|
||||
//update menu
|
||||
});
|
||||
|
Reference in New Issue
Block a user