v1.18.x
psychobunny 12 years ago
parent 3f70d45f3d
commit 561ee9e4f1

@ -765,7 +765,7 @@ define(function() {
var pagination; var pagination;
var postcount = templates.get('postcount'); Topic.postCount = templates.get('postcount');
function updateHeader() { function updateHeader() {
if (pagination == null) { if (pagination == null) {
@ -784,9 +784,9 @@ define(function() {
var scrollTop = jQuery(window).scrollTop(); var scrollTop = jQuery(window).scrollTop();
var scrollBottom = scrollTop + windowHeight; var scrollBottom = scrollTop + windowHeight;
if (scrollTop < 50 && postcount > 1) { if (scrollTop < 50 && Topic.postCount > 1) {
localStorage.removeItem("topic:" + tid + ":bookmark"); localStorage.removeItem("topic:" + tid + ":bookmark");
pagination.innerHTML = '0 out of ' + postcount; pagination.innerHTML = '0 out of ' + Topic.postCount;
return; return;
} }
@ -812,13 +812,13 @@ define(function() {
smallestNonNegative = Number.MAX_VALUE; smallestNonNegative = Number.MAX_VALUE;
} }
pagination.innerHTML = this.postnumber + ' out of ' + postcount; pagination.innerHTML = this.postnumber + ' out of ' + Topic.postCount;
} }
}); });
setTimeout(function() { setTimeout(function() {
if (scrollTop + windowHeight == jQuery(document).height()) { if (scrollTop + windowHeight == jQuery(document).height()) {
pagination.innerHTML = postcount + ' out of ' + postcount; pagination.innerHTML = Topic.postCount + ' out of ' + Topic.postCount;
} }
}, 100); }, 100);
} }
@ -929,7 +929,8 @@ define(function() {
} }
function updatePostCount() { function updatePostCount() {
$('#topic-post-count').html($('#post-container li[data-pid]:not(.deleted)').length); Topic.postCount = $('#post-container li[data-pid]:not(.deleted)').length;
$('#topic-post-count').html(Topic.postCount);
} }
function loadMorePosts(tid, callback) { function loadMorePosts(tid, callback) {

Loading…
Cancel
Save