2014-07-05 11:24:28 +09:00
|
|
|
Template[getTemplate('nav')].helpers({
|
2014-08-15 11:51:30 +09:00
|
|
|
primaryNav: function () {
|
2014-12-30 17:44:33 +09:00
|
|
|
return _.sortBy(primaryNav, 'order');
|
2014-08-15 11:51:30 +09:00
|
|
|
},
|
|
|
|
hasPrimaryNav: function () {
|
|
|
|
return !!primaryNav.length;
|
|
|
|
},
|
|
|
|
secondaryNav: function () {
|
2014-12-30 17:44:33 +09:00
|
|
|
return _.sortBy(secondaryNav, 'order');
|
2014-08-15 11:51:30 +09:00
|
|
|
},
|
|
|
|
hasSecondaryNav: function () {
|
|
|
|
return !!secondaryNav.length;
|
2014-06-23 11:40:21 +09:00
|
|
|
},
|
2014-08-15 11:56:53 +09:00
|
|
|
dropdownClass: function () {
|
2015-03-13 15:27:24 +09:00
|
|
|
// only use dropdowns for top nav
|
|
|
|
return getSetting('navLayout', 'top-nav') == 'top-nav' && getThemeSetting('useDropdowns', true) ? 'has-dropdown' : 'no-dropdown';
|
2014-08-15 11:56:53 +09:00
|
|
|
},
|
2015-03-12 18:07:23 +09:00
|
|
|
logoTemplate: function () {
|
|
|
|
return getTemplate('logo');
|
|
|
|
},
|
2014-08-13 17:12:52 +09:00
|
|
|
getTemplate: function () {
|
2014-12-30 17:44:33 +09:00
|
|
|
return getTemplate(this.template);
|
2014-08-13 17:12:52 +09:00
|
|
|
},
|
2015-02-11 18:02:56 +09:00
|
|
|
headerClass: function () {
|
|
|
|
var color = getSetting('headerColor');
|
|
|
|
return (color == 'white' || color == '#fff' || color == '#ffffff') ? "white-background" : '';
|
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();
|
2015-01-26 00:42:30 -08:00
|
|
|
e.stopPropagation(); // Make sure we don't immediately close the mobile nav again. See layout.js event handler.
|
2013-11-15 15:29:39 +09:00
|
|
|
$('body').toggleClass('mobile-nav-open');
|
|
|
|
}
|
2013-11-24 16:13:53 +02:00
|
|
|
});
|