2015-04-13 14:52:03 +09:00
|
|
|
Template.layout.helpers({
|
2015-03-12 18:07:23 +09:00
|
|
|
navLayout: function () {
|
2015-03-28 18:30:26 +09:00
|
|
|
return Settings.get('navLayout', 'top-nav');
|
2015-03-12 18:07:23 +09:00
|
|
|
},
|
2013-01-16 07:25:39 +09:00
|
|
|
pageName : function(){
|
2014-09-10 18:32:59 -05:00
|
|
|
return getCurrentTemplate();
|
2013-02-14 10:17:26 +09:00
|
|
|
},
|
2015-02-24 14:07:58 -05:00
|
|
|
extraCode: function() {
|
2015-03-28 18:30:26 +09:00
|
|
|
return Settings.get('extraCode');
|
2015-02-24 14:07:58 -05:00
|
|
|
},
|
2014-08-05 10:16:05 +09:00
|
|
|
heroModules: function () {
|
2015-03-16 10:00:11 +09:00
|
|
|
return _.sortBy(heroModules, 'order');
|
2014-08-05 10:16:05 +09:00
|
|
|
}
|
2013-01-16 07:25:39 +09:00
|
|
|
});
|
|
|
|
|
2015-04-13 14:52:03 +09:00
|
|
|
Template.layout.created = function(){
|
2013-01-16 07:25:39 +09:00
|
|
|
Session.set('currentScroll', null);
|
2014-09-16 15:18:27 -04:00
|
|
|
};
|
2012-10-18 15:59:21 +09:00
|
|
|
|
2015-04-13 14:52:03 +09:00
|
|
|
Template.layout.rendered = function(){
|
2014-05-23 13:08:40 +09:00
|
|
|
if(currentScroll=Session.get('currentScroll')){
|
|
|
|
$('body').scrollTop(currentScroll);
|
|
|
|
Session.set('currentScroll', null);
|
|
|
|
}
|
2015-02-14 19:03:22 +09:00
|
|
|
|
|
|
|
// favicon
|
|
|
|
var link = document.createElement('link');
|
|
|
|
link.type = 'image/x-icon';
|
|
|
|
link.rel = 'shortcut icon';
|
2015-03-28 18:30:26 +09:00
|
|
|
link.href = Settings.get('faviconUrl', '/img/favicon.ico');
|
2015-02-14 19:03:22 +09:00
|
|
|
document.getElementsByTagName('head')[0].appendChild(link);
|
|
|
|
|
2014-09-16 15:18:27 -04:00
|
|
|
};
|
2015-01-26 00:42:30 -08:00
|
|
|
|
2015-04-13 14:52:03 +09:00
|
|
|
Template.layout.events({
|
2015-01-26 00:42:30 -08:00
|
|
|
'click .inner-wrapper': function (e) {
|
|
|
|
if ($('body').hasClass('mobile-nav-open')) {
|
|
|
|
e.preventDefault();
|
|
|
|
$('body').removeClass('mobile-nav-open');
|
|
|
|
}
|
|
|
|
}
|
2015-03-28 18:30:26 +09:00
|
|
|
});
|