#28 reimplemented for 7.0/Backbone implementation

This commit is contained in:
Jason White 2015-09-13 00:15:19 -04:00
parent 9348a0d70e
commit 78215a7f55
3 changed files with 33 additions and 5 deletions

View File

@ -37,8 +37,6 @@
<!-- Require.js used to load js asynchronously -->
<script src="js/libs/require.min.js" data-main="js/main.js"></script>
<!--<script src="js/jquery/jquery-1.10.2.min.js"></script>
<script src="plugins/bootstrap/js/bootstrap.min.js"></script>-->
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>WebGoat</title>
</head>
@ -51,7 +49,7 @@
</div>
<!--logo end-->
<div class="toggle-navigation toggle-left">
<button type="button" class="btn btn-default" id="toggle-left" data-toggle="tooltip" data-placement="right" title="Toggle Navigation">
<button type="button" class="btn btn-default" id="toggle-menu" data-toggle="tooltip" data-placement="right" title="Toggle Navigation">
<i class="fa fa-bars"></i>
</button>
</div><!--toggle navigation end-->

View File

@ -12,7 +12,8 @@ define(['jquery',
'goatApp/view/ParamView',
'goatApp/model/ParamModel',
'goatApp/support/GoatUtils',
'goatApp/view/UserAndInfoView'
'goatApp/view/UserAndInfoView',
'goatApp/view/MenuButtonView'
],
function($,
_,
@ -28,7 +29,8 @@ define(['jquery',
ParamView,
ParamModel,
GoatUtils,
UserAndInfoView
UserAndInfoView,
MenuButtonView
) {
'use strict'
@ -43,6 +45,7 @@ define(['jquery',
this.listenTo(this.lessonContent,'contentLoaded',this.onContentLoaded);
//'static' elements of page/app
this.userAndInfoView = new UserAndInfoView();
this.menuButtonView = new MenuButtonView();
};
//load View, which can pull data
this.loadLesson = function(scr,menu,stage) {

View File

@ -0,0 +1,27 @@
//
//UserAndInfoView
define(['jquery',
'underscore',
'backbone'],
function($,
_,
Backbone) {
return Backbone.View.extend({
el:'#toggle-menu', //Check this,
initialize: function() {
this.$el.on('click',this.toggleMenu);
},
toggleMenu: function() {
//left
if (!$('.sidebarRight').hasClass('.sidebar-toggle-right')) {
$('.sidebarRight').removeClass('sidebar-toggle-right');
$('.main-content-wrapper').removeClass('main-content-toggle-right');
}
$('.sidebar').toggleClass('sidebar-toggle');
$('.main-content-wrapper').toggleClass('main-content-toggle-left');
//e.stopPropagation();
}
});
});