Vulcan/client/views/nav/nav.js

51 lines
1.2 KiB
JavaScript
Raw Normal View History

2014-07-05 11:24:28 +09:00
Template[getTemplate('nav')].helpers({
primaryNav: function () {
return primaryNav;
},
hasPrimaryNav: function () {
return !!primaryNav.length;
},
secondaryNav: function () {
return secondaryNav;
},
hasSecondaryNav: function () {
return !!secondaryNav.length;
2014-06-23 11:40:21 +09:00
},
2014-08-15 11:56:53 +09:00
dropdownClass: function () {
return getThemeSetting('useDropdowns', true) ? 'has-dropdown' : 'no-dropdown';
2014-08-15 11:56:53 +09:00
},
2014-08-13 17:12:52 +09:00
getTemplate: function () {
return getTemplate(this);
},
userMenu: function () {
return getTemplate('userMenu');
},
2012-09-29 12:28:51 +09:00
site_title: function(){
return getSetting('title');
2012-10-05 11:02:03 +09:00
},
logo_url: function(){
2012-09-29 12:28:51 +09:00
return getSetting('logoUrl');
2012-10-05 11:02:03 +09:00
},
logo_top: function(){
2012-09-29 12:28:51 +09:00
return Math.floor((70-getSetting('logoHeight'))/2);
},
2012-10-05 11:02:03 +09:00
logo_offset: function(){
2012-09-29 12:28:51 +09:00
return -Math.floor(getSetting('logoWidth')/2);
2012-10-05 11:02:03 +09:00
},
intercom: function(){
return !!getSetting('intercomId');
2012-10-05 13:59:40 +09:00
},
canPost: function(){
return canPost(Meteor.user());
2012-10-24 11:04:42 +09:00
},
requirePostsApproval: function(){
return getSetting('requirePostsApproval');
2013-04-06 16:50:40 +09:00
}
2013-11-14 23:01:59 -05:00
});
2013-11-15 15:29:39 +09:00
2014-07-05 11:24:28 +09:00
Template[getTemplate('nav')].events({
2014-07-09 09:46:24 +09:00
'click .mobile-menu-button': function(e){
2013-11-15 15:29:39 +09:00
e.preventDefault();
$('body').toggleClass('mobile-nav-open');
}
});