2015-04-13 14:52:03 +09:00
|
|
|
Template.mobile_nav.helpers({
|
2015-03-24 17:03:37 +09:00
|
|
|
mobileNav: function () {
|
2015-04-20 13:57:37 +09:00
|
|
|
return _.sortBy(Telescope.config.mobileNav, 'order');
|
2014-07-09 09:46:24 +09:00
|
|
|
},
|
2015-03-24 17:03:37 +09:00
|
|
|
mobileContext: function () {
|
|
|
|
return {mobile: true};
|
2014-07-09 09:46:24 +09:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-04-13 14:52:03 +09:00
|
|
|
Template.mobile_nav.events({
|
2015-04-03 09:48:30 +09:00
|
|
|
'click .menu-sub-level': function () {
|
2012-12-05 11:05:05 +09:00
|
|
|
$('body').toggleClass('mobile-nav-open');
|
|
|
|
}
|
2014-07-10 11:45:34 +09:00
|
|
|
});
|
|
|
|
|
2015-04-13 14:52:03 +09:00
|
|
|
Template.mobile_nav.events({
|
2015-04-03 09:48:30 +09:00
|
|
|
'click .menu-top-level': function (e) {
|
2014-07-10 11:45:34 +09:00
|
|
|
e.preventDefault();
|
|
|
|
$(e.currentTarget).next().slideToggle('fast');
|
2014-08-12 17:11:36 +09:00
|
|
|
},
|
|
|
|
'click .mobile-nav a': function (e) {
|
2015-04-03 09:48:30 +09:00
|
|
|
if (e.target.className.indexOf('menu-top-level') == -1){
|
2014-08-12 17:11:36 +09:00
|
|
|
$('body').removeClass('mobile-nav-open');
|
|
|
|
}
|
2014-07-10 11:45:34 +09:00
|
|
|
}
|
2015-04-13 16:29:33 +09:00
|
|
|
});
|