Vulcan/client/views/nav/nav.js
Anthony Mayer 23b72b9cb8 Switching from manually generating urls to using IronRouter functions.
Using {{pathFor}}, path(), and url() where possible. Passing in path
to Meteor.absoluteUrl() where the IronRouter functions didn't make sense.
Also deleting some random unused code.
2014-12-03 00:06:00 -08:00

51 lines
No EOL
1.2 KiB
JavaScript

Template[getTemplate('nav')].helpers({
primaryNav: function () {
return primaryNav;
},
hasPrimaryNav: function () {
return !!primaryNav.length;
},
secondaryNav: function () {
return secondaryNav;
},
hasSecondaryNav: function () {
return !!secondaryNav.length;
},
dropdownClass: function () {
return getThemeSetting('useDropdowns', true) ? 'has-dropdown' : 'no-dropdown';
},
getTemplate: function () {
return getTemplate(this);
},
userMenu: function () {
return getTemplate('userMenu');
},
site_title: function(){
return getSetting('title');
},
logo_url: function(){
return getSetting('logoUrl');
},
logo_top: function(){
return Math.floor((70-getSetting('logoHeight'))/2);
},
logo_offset: function(){
return -Math.floor(getSetting('logoWidth')/2);
},
intercom: function(){
return !!getSetting('intercomId');
},
canPost: function(){
return canPost(Meteor.user());
},
requirePostsApproval: function(){
return getSetting('requirePostsApproval');
}
});
Template[getTemplate('nav')].events({
'click .mobile-menu-button': function(e){
e.preventDefault();
$('body').toggleClass('mobile-nav-open');
}
});