Move loading of developer controls so they do not reload every time. Also reload current lesson after reloading labels. Ref webgoat/webgoat#93.

This commit is contained in:
Daniel Kvist 2016-03-31 22:56:17 +02:00
parent 2be4248ea3
commit 58ae7f3727
3 changed files with 8 additions and 8 deletions

View File

@ -11,7 +11,6 @@ define(['jquery',
'goatApp/view/CookieView',
'goatApp/view/ParamView',
'goatApp/model/ParamModel',
'goatApp/view/DeveloperControlsView',
'goatApp/support/GoatUtils',
'goatApp/view/UserAndInfoView',
'goatApp/view/MenuButtonView',
@ -31,7 +30,6 @@ define(['jquery',
CookieView,
ParamView,
ParamModel,
DeveloperControlsView,
GoatUtils,
UserAndInfoView,
MenuButtonView,
@ -118,7 +116,6 @@ define(['jquery',
this.sourceView = new SourceView();
this.lessonHintView = new HintView();
this.cookieView = new CookieView();
this.developerControlsView = new DeveloperControlsView();
//TODO: instantiate model with values (not sure why was not working before)
var paramModel = new ParamModel({});

View File

@ -22,9 +22,9 @@ function(
},
onLabelsLoaded: function(model) {
$('#' + model.id).find('td').text('Enabled: ' + model.enabled);
this.models[1] = model;
this.render();
Backbone.history.loadUrl(Backbone.history.getFragment());
},
initialize: function(options) {

View File

@ -4,17 +4,20 @@ define(['jquery',
'goatApp/controller/LessonController',
'goatApp/controller/MenuController',
'goatApp/view/LessonContentView',
'goatApp/view/MenuView'
'goatApp/view/MenuView',
'goatApp/view/DeveloperControlsView'
], function ($,
_,
Backbone,
LessonController,
MenuController,
LessonContentView,
MenuView) {
MenuView,
DeveloperControlsView) {
var lessonView = new LessonContentView();
var menuView = new MenuView();
var developerControlsView = new DeveloperControlsView();
var GoatAppRouter = Backbone.Router.extend({
routes: {