Skip to content

Commit

Permalink
Rewrote mobile-menu.js as a plain script (not using require.js)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmispelon committed Jan 22, 2024
1 parent 4221609 commit 9cb409c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 28 deletions.
4 changes: 1 addition & 3 deletions trac-env/htdocs/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ requirejs.config({

define(function(){

var mods = [
'mod/mobile-menu' //require mobile menu automatically
];
var mods = [];

//detect Class function
function hasClass( className ) {
Expand Down
11 changes: 11 additions & 0 deletions trac-env/htdocs/js/mobile-menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
jQuery(document).ready(function($) {
var menu = $('[role="banner"] [role="navigation"]');
var button = $('<div class="menu-button"><i class="icon icon-reorder"></i><span>Menu</span></div>');

menu.addClass('nav-menu-on');
button.insertBefore(menu);
button.on('click', function(){
menu.toggleClass('active');
button.toggleClass('active')
});
})
25 changes: 0 additions & 25 deletions trac-env/htdocs/js/mod/mobile-menu.js

This file was deleted.

1 change: 1 addition & 0 deletions trac-env/templates/site.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,6 @@ <h2>Follow Us</h2>


<script data-main="${href.chrome('site/js/main.js')}" src="${href.chrome('site/js/lib/require.js')}"></script>
<script src="${href.chrome('site/js/mobile-menu.js')}"></script>
</body>
</html>

0 comments on commit 9cb409c

Please sign in to comment.