mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
26 lines
609 B
JavaScript
26 lines
609 B
JavaScript
Template.mobile_nav.helpers({
|
|
mobileNav: function () {
|
|
return _.sortBy(mobileNav, 'order');
|
|
},
|
|
mobileContext: function () {
|
|
return {mobile: true};
|
|
}
|
|
});
|
|
|
|
Template.mobile_nav.events({
|
|
'click .menu-sub-level': function () {
|
|
$('body').toggleClass('mobile-nav-open');
|
|
}
|
|
});
|
|
|
|
Template.mobile_nav.events({
|
|
'click .menu-top-level': function (e) {
|
|
e.preventDefault();
|
|
$(e.currentTarget).next().slideToggle('fast');
|
|
},
|
|
'click .mobile-nav a': function (e) {
|
|
if (e.target.className.indexOf('menu-top-level') == -1){
|
|
$('body').removeClass('mobile-nav-open');
|
|
}
|
|
}
|
|
});
|