Vulcan/client/views/common/layout.js
Tarang Patel cbae924d24 Have no title if there isn't a title set instead of undefined
Usually the title is `undefined`. This way it shows the URL instead if nothing is set in settings.
2013-11-11 21:57:47 +02:00

36 lines
872 B
JavaScript

Template.layout.helpers({
pageName : function(){
getCurrentTemplate();
},
backgroundColor: function(){
return getSetting('backgroundColor');
},
secondaryColor: function(){
return getSetting('secondaryColor');
},
buttonColor: function(){
return getSetting('buttonColor');
},
headerColor: function(){
return getSetting('headerColor');
},
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);
}
// set title
var title = getSetting("title");
var tagline = getSetting("tagline");
document.title = (tagline ? title+': '+tagline : title) || "";
}