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,57 @@
//var goatApp = goatApp || {};
define(['jquery','underscore','backbone'], function($,_,Backbone) {
var menuData = Backbone.Model.extend({
urlRoot:'/webgoat/service/lessonmenu.mvc',
defaults: {
items:null,
selectedItem:null
},
initialize: function () {
var self = this;
this.fetch().then(function(menuItems){
menuItems = goatUtils.enhanceMenuData(menuItems,this.selectedItem);
this.setDataItems(menuItems);
});
},
update: function() {
var self = this;
this.fetch().then(function(menuItems) {
menuItems = goatUtils.enhanceMenuData(menuItems,this.selectedItem);
self.setDataItems(menuItems);
});
},
setDataItems: function (data) {
this.items = data;
}
});
});
/*
var menuData = Backbone.Model.extend({
urlRoot:'/webgoat/service/lessonmenu.mvc',
defaults: {
items:null,
selectedItem:null
},
initialize: function () {
var self = this;
this.fetch().then(function(menuItems){
menuItems = goatUtils.enhanceMenuData(menuItems,this.selectedItem);
self.items = menuItems;
});
},
update: function() {
var self = this;
this.fetch().then(function(data) {
self.items = data;
self.render(0);
});
}
});
*/