Skip to content

Commit

Permalink
WIP : Mmenu 😆
Browse files Browse the repository at this point in the history
  • Loading branch information
bpongy committed May 24, 2018
1 parent fbb7a98 commit 589506c
Show file tree
Hide file tree
Showing 88 changed files with 1,003 additions and 1,393 deletions.
191 changes: 89 additions & 102 deletions assets/css/base.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 29 additions & 24 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,39 @@


/********************************************
* slideout.js navigation menu
* Mmenu navigation menu
********************************************/
var slideout = new Slideout({
'panel': document.getElementById('playground'),
'menu': document.getElementById('navmob'),
'padding': 256,
'tolerance': 70
var $btn_mobile_menu = $("#btn-mobile-menu");
$("#navmob").mmenu({
"navbar": {
"add": false
}
}, {
// configuration
offCanvas: {
pageSelector: "#playground"
},
classNames: {
selected: "current-menu-item"
}
});
var API = $("#navmob").data( "mmenu" );

$btn_mobile_menu.on('click', function() {
API.open();
});
// Toggle button
$('.js-slideout-toggle').on('click', function() {
slideout.open();

API.bind( "open:finish", function() {
setTimeout(function() {
$btn_mobile_menu.addClass( "active" );
}, 100);
});

function close(eve) {
eve.preventDefault();
slideout.close();
}
slideout
.on('beforeopen', function() {
this.panel.classList.add('panel-open');
})
.on('open', function() {
this.panel.addEventListener('click', close);
})
.on('beforeclose', function() {
this.panel.classList.remove('panel-open');
this.panel.removeEventListener('click', close);
});
API.bind( "close:finish", function() {
setTimeout(function() {
$btn_mobile_menu.removeClass( "active" );
}, 100);
});



Expand Down
Loading

0 comments on commit 589506c

Please sign in to comment.