2013-10-06 08:42:10 +09:00
|
|
|
Template.layout.helpers({
|
2013-01-16 07:25:39 +09:00
|
|
|
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});
|
|
|
|
return currentRoute.name;
|
|
|
|
}
|
2013-02-14 10:17:26 +09:00
|
|
|
},
|
|
|
|
backgroundColor: function(){
|
2013-02-16 13:05:32 +09:00
|
|
|
return getSetting('backgroundColor');
|
2013-02-14 10:17:26 +09:00
|
|
|
},
|
|
|
|
secondaryColor: function(){
|
2013-02-16 13:05:32 +09:00
|
|
|
return getSetting('secondaryColor');
|
2013-02-14 10:17:26 +09:00
|
|
|
},
|
|
|
|
buttonColor: function(){
|
2013-02-16 13:05:32 +09:00
|
|
|
return getSetting('buttonColor');
|
2013-02-14 10:17:26 +09:00
|
|
|
},
|
|
|
|
headerColor: function(){
|
2013-02-16 13:05:32 +09:00
|
|
|
return getSetting('headerColor');
|
2013-02-28 09:19:08 +09:00
|
|
|
},
|
|
|
|
extraCode: function(){
|
|
|
|
return getSetting('extraCode');
|
|
|
|
}
|
2013-01-16 07:25:39 +09:00
|
|
|
});
|
|
|
|
|
2013-10-06 08:42:10 +09:00
|
|
|
Template.layout.created = function(){
|
2013-01-16 07:25:39 +09:00
|
|
|
Session.set('currentScroll', null);
|
2012-10-18 15:59:21 +09:00
|
|
|
}
|
|
|
|
|
2013-10-06 08:42:10 +09:00
|
|
|
Template.layout.rendered = function(){
|
2012-10-18 15:59:21 +09:00
|
|
|
if(currentScroll=Session.get('currentScroll')){
|
|
|
|
$('body').scrollTop(currentScroll);
|
2012-10-19 12:33:47 +09:00
|
|
|
Session.set('currentScroll', null);
|
2013-01-16 07:25:39 +09:00
|
|
|
}
|
2013-02-16 13:30:46 +09:00
|
|
|
}
|