recent changes, commit prior to merge

This commit is contained in:
Jason White
2015-04-25 22:12:52 -04:00
parent 22c4ed27e4
commit 7a5c8083f5
9 changed files with 383 additions and 174 deletions

View File

@ -0,0 +1,23 @@
//LessonContentView
define(['jquery',
'underscore',
'backbone',
'goatApp/model/LessonContentData'],
function($,_,Backbone,LessonData) {
var contentView = Backbone.View.extend({
el:'#lessonContent',
initialize: function(options) {
//this.content = options.content;
this.lessonData = {};
this.listenTo(this.lessonData,'sync',this.render);
},
loadLesson: function(options) {
this.lessonData = new LessonData(options.screen,options.menu);
},
render: function() {
alert('render');
this.$el.html(this.content);
}
});
});

View File

@ -1,4 +1,4 @@
define(['jquery','underscore','backbone','goatApp/model/goatMenu'], function($,_,Backbone,MenuData) {
define(['jquery','underscore','backbone','goatApp/model/MenuData'], function($,_,Backbone,MenuData) {
return Backbone.View.extend({
el:'#menuContainer',

View File

@ -1,34 +1,44 @@
define(['jquery',
'underscore',
'backbone',
'goatApp/controller/LessonController'
], function ($,_,Backbone,LessonController) {
var GoatAppRouter = Backbone.Router.extend({
routes: {
//#....
'welcome':'welcomeRoute',
'attack/:scr/:menu':'attackRoute' //
},
lessonController: new LessonController()
});
'goatApp/controller/LessonController',
'goatApp/controller/MenuController',
'goatApp/view/LessonContentView',
'goatApp/view/MenuView'
], function ($,_,Backbone,LessonController,MenuController,LessonView,MenuView) {
var init = function() {
goatRouter = new GoatAppRouter();
goatRouter.on('route:attackRoute', function(scr,menu) {
this.lessonController.loadLesson(scr,menu);
var lessonView = new LessonContentView();
var menuView = new MenuView();
var GoatAppRouter = Backbone.Router.extend({
routes: {
//#....
'welcome':'welcomeRoute',
'attack/:scr/:menu':'attackRoute' //
},
lessoonController: lessoonController({
lessonView:lessonView
}),
menuView: new MenuController({
menuView:menuView
});
});
goatRouter.on('route:welcomeRoute', function() {
alert('welcome route');
});
// init the history/router
Backbone.history.start();
}
return {
init:init
};
var init = function() {
goatRouter = new GoatAppRouter();
goatRouter.on('route:attackRoute', function(scr,menu) {
this.lessonController.loadLesson(scr,menu);
//update menu
});
goatRouter.on('route:welcomeRoute', function() {
alert('welcome route');
});
// init the history/router
Backbone.history.start();
}
return {
init:init
};
});