Vulcan/client/views/common/layout.js
2015-01-26 00:46:43 -08:00

49 lines
No EOL
1.1 KiB
JavaScript

Template[getTemplate('layout')].helpers({
mobile_nav: function () {
return getTemplate('mobile_nav');
},
nav: function () {
return getTemplate('nav');
},
messages: function () {
return getTemplate('messages');
},
notifications: function () {
return getTemplate('notifications');
},
footer: function () {
return getTemplate('footer');
},
pageName : function(){
return getCurrentTemplate();
},
css: function () {
return getTemplate('css');
},
heroModules: function () {
return heroModules;
},
getTemplate: function () {
return getTemplate(this.template);
}
});
Template[getTemplate('layout')].created = function(){
Session.set('currentScroll', null);
};
Template[getTemplate('layout')].rendered = function(){
if(currentScroll=Session.get('currentScroll')){
$('body').scrollTop(currentScroll);
Session.set('currentScroll', null);
}
};
Template[getTemplate('layout')].events({
'click .inner-wrapper': function (e) {
if ($('body').hasClass('mobile-nav-open')) {
e.preventDefault();
$('body').removeClass('mobile-nav-open');
}
}
});