mirror of
https://github.com/vale981/Vulcan
synced 2025-03-09 20:16:39 -04:00

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.
51 lines
No EOL
1.2 KiB
JavaScript
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');
|
|
}
|
|
}); |