diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js
index 07c8e970ab..7aa385bfa4 100644
--- a/public/src/forum/topic.js
+++ b/public/src/forum/topic.js
@@ -605,39 +605,53 @@
- 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();
+ var scrollTop = jQuery(window).scrollTop();
+ var scrollBottom = scrollTop + jQuery(window).height();
- 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();
- return;
- }
-
- jQuery('.sub-posts').each(function() {
- var el = jQuery(this);
- var elTop = el.offset().top;
- var height = Math.floor(el.height());
- var elBottom = elTop + (height < 300 ? height : 300);
-
- var inView = ((elBottom >= scrollTop) && (elTop <= scrollBottom)
- && (elBottom <= scrollBottom) && (elTop >= scrollTop) );
+ 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;
+ }
- if (inView) {
+ var count = 0;
- 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();
+ jQuery('.sub-posts').each(function() {
+ count++;
+ this.postnumber = count;
- }
- });
+
+ var el = jQuery(this);
+ var elTop = el.offset().top;
+ var height = Math.floor(el.height());
+ var elBottom = elTop + (height < 300 ? height : 300);
+
+ var inView = ((elBottom >= scrollTop) && (elTop <= scrollBottom)
+ && (elBottom <= scrollBottom) && (elTop >= scrollTop));
+
+
+ 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;
diff --git a/public/templates/header.tpl b/public/templates/header.tpl
index baeb3c039f..cb9fe29f66 100644
--- a/public/templates/header.tpl
+++ b/public/templates/header.tpl
@@ -42,7 +42,9 @@
- {title}
+ {title}