mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
Set Session variable to signal posts list pages
This commit is contained in:
parent
beb6d245b0
commit
29d379d3f9
4 changed files with 13 additions and 9 deletions
|
@ -215,6 +215,13 @@
|
|||
if(Meteor.Router.page() !== "loading"){
|
||||
console.log('------ Request start -------- ('+Meteor.Router.page()+')');
|
||||
|
||||
|
||||
if(_.contains(['posts_top', 'posts_new', 'posts_digest', 'posts_pending', 'posts_best'], Meteor.Router.page())){
|
||||
Session.set('isPostsList', true);
|
||||
}else{
|
||||
Session.set('isPostsList', false);
|
||||
}
|
||||
|
||||
// openedComments is an Array that tracks which comments
|
||||
// have been expanded by the user, to make sure they stay expanded
|
||||
Session.set("openedComments", null);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template name="footer">
|
||||
<div class="footer grid" style="top: {{distanceFromTop}}px">
|
||||
<div class="footer grid {{footerClass}}" style="top: {{distanceFromTop}}px">
|
||||
{{{footerCode}}}
|
||||
</div>
|
||||
</template>
|
|
@ -5,11 +5,8 @@ Template.footer.helpers({
|
|||
distanceFromTop: function(){
|
||||
console.log('distanceFromTop', Session.get('distanceFromTop'))
|
||||
return parseInt(Session.get('distanceFromTop'))+70+20+70;
|
||||
},
|
||||
footerClass: function(){
|
||||
return Session.get('isPostsList') ? 'absolute' : 'static';
|
||||
}
|
||||
});
|
||||
|
||||
Template.footer.rendered = function(){
|
||||
if(_.contains(['posts_top', 'posts_new', 'posts_digest', 'posts_pending'], Meteor.Router.page())){
|
||||
$('.footer').addClass('absolute');
|
||||
}
|
||||
}
|
||||
});
|
|
@ -12,7 +12,7 @@ Template.post_item.helpers({
|
|||
return this._rank + 1;
|
||||
},
|
||||
showRank: function(){
|
||||
return _.contains(['posts_top', 'posts_new', 'posts_digest', 'posts_pending'], Meteor.Router.page());
|
||||
return Session.get('isPostsList');
|
||||
},
|
||||
domain: function(){
|
||||
var a = document.createElement('a');
|
||||
|
|
Loading…
Add table
Reference in a new issue