Vulcan/client/views/common/layout.js

49 lines
1.1 KiB
JavaScript
Raw Normal View History

2014-07-05 11:24:28 +09:00
Template[getTemplate('layout')].helpers({
2014-07-05 11:42:28 +09:00
mobile_nav: function () {
return getTemplate('mobile_nav');
},
nav: function () {
return getTemplate('nav');
},
2014-12-06 17:49:17 +09:00
messages: function () {
return getTemplate('messages');
2014-07-05 11:42:28 +09:00
},
notifications: function () {
return getTemplate('notifications');
},
footer: function () {
return getTemplate('footer');
},
pageName : function(){
return getCurrentTemplate();
2013-02-14 10:17:26 +09:00
},
css: function () {
return getTemplate('css');
},
heroModules: function () {
return heroModules;
},
getTemplate: function () {
return getTemplate(this.template);
}
});
2014-07-05 11:24:28 +09:00
Template[getTemplate('layout')].created = function(){
Session.set('currentScroll', null);
};
2014-07-05 11:24:28 +09:00
Template[getTemplate('layout')].rendered = function(){
2014-05-23 13:08:40 +09:00
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');
}
}
});