|
|
|
@ -605,12 +605,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var postAuthorImage, postAuthorInfo;
|
|
|
|
|
var postAuthorImage, postAuthorInfo, pagination;
|
|
|
|
|
var postcount = templates.get('postcount');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function updateHeader() {
|
|
|
|
|
jQuery('.post-author-info').css('bottom', '0px');
|
|
|
|
|
postAuthorImage = postAuthorImage || document.getElementById('post-author-image');
|
|
|
|
|
postAuthorInfo = postAuthorInfo || document.getElementById('post-author-info');
|
|
|
|
|
pagination = pagination || document.getElementById('pagination');
|
|
|
|
|
|
|
|
|
|
var scrollTop = jQuery(window).scrollTop();
|
|
|
|
|
var scrollBottom = scrollTop + jQuery(window).height();
|
|
|
|
@ -618,10 +621,18 @@
|
|
|
|
|
if (scrollTop < 50) {
|
|
|
|
|
postAuthorImage.src = (jQuery('.main-avatar img').attr('src'));
|
|
|
|
|
postAuthorInfo.innerHTML = 'Posted by ' + jQuery('.main-post').attr('data-username') + ', ' + jQuery('.main-post').find('.relativeTimeAgo').html();
|
|
|
|
|
pagination.innerHTML = '0 / ' + postcount;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var count = 0;
|
|
|
|
|
|
|
|
|
|
jQuery('.sub-posts').each(function() {
|
|
|
|
|
count++;
|
|
|
|
|
this.postnumber = count;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var el = jQuery(this);
|
|
|
|
|
var elTop = el.offset().top;
|
|
|
|
|
var height = Math.floor(el.height());
|
|
|
|
@ -632,12 +643,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (inView) {
|
|
|
|
|
|
|
|
|
|
pagination.innerHTML = this.postnumber + ' / ' + postcount;
|
|
|
|
|
postAuthorImage.src = (jQuery(this).find('.profile-image-block img').attr('src'));
|
|
|
|
|
postAuthorInfo.innerHTML = 'Posted by ' + jQuery(this).attr('data-username') + ', ' + jQuery(this).find('.relativeTimeAgo').html();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (scrollTop >= jQuery(window).height()) {
|
|
|
|
|
//pagination.innerHTML = postcount + ' / ' + postcount;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
window.onscroll = updateHeader;
|
|
|
|
|