Vulcan/client/views/nav/nav.js

33 lines
827 B
JavaScript
Raw Normal View History

2014-07-05 11:24:28 +09:00
Template[getTemplate('nav')].helpers({
primaryNav: function () {
return _.sortBy(primaryNav, 'order');
},
hasPrimaryNav: function () {
return !!primaryNav.length;
},
secondaryNav: function () {
return _.sortBy(secondaryNav, 'order');
},
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.template);
2014-08-13 17:12:52 +09:00
},
2012-09-29 12:28:51 +09:00
site_title: function(){
2014-12-31 17:44:21 +09:00
return getSetting('title', "Telescope");
2012-10-05 11:02:03 +09:00
},
logo_url: function(){
2012-09-29 12:28:51 +09:00
return getSetting('logoUrl');
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');
}
});