Vulcan/client/views/nav/mobile_nav.js

42 lines
1 KiB
JavaScript
Raw Normal View History

2014-07-09 09:46:24 +09:00
Template[getTemplate('mobile_nav')].helpers({
primaryNav: function () {
return primaryNav;
},
secondaryNav: function () {
return secondaryNav;
2014-07-09 09:46:24 +09:00
},
2014-08-13 17:34:56 +09:00
getTemplate: function () {
return getTemplate(this);
},
2014-07-09 09:46:24 +09:00
canPost: function(){
return canPost(Meteor.user());
},
requirePostsApproval: function(){
return getSetting('requirePostsApproval');
2014-08-12 17:11:36 +09:00
},
userMenu: function () {
return getTemplate('userMenu');
2014-07-09 09:46:24 +09:00
}
});
2014-07-05 11:24:28 +09:00
Template[getTemplate('mobile_nav')].events({
'click .dropdown-sub-level': function () {
2012-12-05 11:05:05 +09:00
$('body').toggleClass('mobile-nav-open');
}
2014-07-10 11:45:34 +09:00
});
Template[getTemplate('mobile_nav')].rendered = function () {
$('.mobile-nav .dropdown-menu').hide();
};
2014-07-10 11:45:34 +09:00
Template[getTemplate('mobile_nav')].events({
2014-08-12 17:11:36 +09:00
'click .dropdown-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) {
if (e.target.className.indexOf('dropdown-top-level') == -1){
$('body').removeClass('mobile-nav-open');
}
2014-07-10 11:45:34 +09:00
}
});