Vulcan/client/views/common/layout.js

37 lines
902 B
JavaScript
Raw Normal View History

Template.layout.helpers({
pageName : function(){
2013-10-06 09:17:37 +09:00
if(Router._current){
var currentPath = Router._current.path;
var currentRoute = _.findWhere(Router.routes, {originalPath: currentPath});
2013-10-06 09:33:00 +09:00
if(currentRoute)
return currentRoute.name;
2013-10-06 09:17:37 +09:00
}
2013-02-14 10:17:26 +09:00
},
backgroundColor: function(){
return getSetting('backgroundColor');
2013-02-14 10:17:26 +09:00
},
secondaryColor: function(){
return getSetting('secondaryColor');
2013-02-14 10:17:26 +09:00
},
buttonColor: function(){
return getSetting('buttonColor');
2013-02-14 10:17:26 +09:00
},
headerColor: function(){
return getSetting('headerColor');
2013-02-28 09:19:08 +09:00
},
extraCode: function(){
return getSetting('extraCode');
}
});
Template.layout.created = function(){
Session.set('currentScroll', null);
}
Template.layout.rendered = function(){
if(currentScroll=Session.get('currentScroll')){
$('body').scrollTop(currentScroll);
Session.set('currentScroll', null);
}
}