#28 reimplemented for 7.0/Backbone implementation
This commit is contained in:
parent
9348a0d70e
commit
78215a7f55
@ -37,8 +37,6 @@
|
|||||||
|
|
||||||
<!-- Require.js used to load js asynchronously -->
|
<!-- Require.js used to load js asynchronously -->
|
||||||
<script src="js/libs/require.min.js" data-main="js/main.js"></script>
|
<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" />
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||||
<title>WebGoat</title>
|
<title>WebGoat</title>
|
||||||
</head>
|
</head>
|
||||||
@ -51,7 +49,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!--logo end-->
|
<!--logo end-->
|
||||||
<div class="toggle-navigation toggle-left">
|
<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>
|
<i class="fa fa-bars"></i>
|
||||||
</button>
|
</button>
|
||||||
</div><!--toggle navigation end-->
|
</div><!--toggle navigation end-->
|
||||||
|
@ -12,7 +12,8 @@ define(['jquery',
|
|||||||
'goatApp/view/ParamView',
|
'goatApp/view/ParamView',
|
||||||
'goatApp/model/ParamModel',
|
'goatApp/model/ParamModel',
|
||||||
'goatApp/support/GoatUtils',
|
'goatApp/support/GoatUtils',
|
||||||
'goatApp/view/UserAndInfoView'
|
'goatApp/view/UserAndInfoView',
|
||||||
|
'goatApp/view/MenuButtonView'
|
||||||
],
|
],
|
||||||
function($,
|
function($,
|
||||||
_,
|
_,
|
||||||
@ -28,7 +29,8 @@ define(['jquery',
|
|||||||
ParamView,
|
ParamView,
|
||||||
ParamModel,
|
ParamModel,
|
||||||
GoatUtils,
|
GoatUtils,
|
||||||
UserAndInfoView
|
UserAndInfoView,
|
||||||
|
MenuButtonView
|
||||||
) {
|
) {
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
@ -43,6 +45,7 @@ define(['jquery',
|
|||||||
this.listenTo(this.lessonContent,'contentLoaded',this.onContentLoaded);
|
this.listenTo(this.lessonContent,'contentLoaded',this.onContentLoaded);
|
||||||
//'static' elements of page/app
|
//'static' elements of page/app
|
||||||
this.userAndInfoView = new UserAndInfoView();
|
this.userAndInfoView = new UserAndInfoView();
|
||||||
|
this.menuButtonView = new MenuButtonView();
|
||||||
};
|
};
|
||||||
//load View, which can pull data
|
//load View, which can pull data
|
||||||
this.loadLesson = function(scr,menu,stage) {
|
this.loadLesson = function(scr,menu,stage) {
|
||||||
|
@ -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();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user