Skip to content

Node.js based forum software built for the modern web

finished pagination for topic view

psychobunny2098bf84a14c
diff --git a/public/css/style.less b/public/css/style.less
index 8416dc9917..fbae92c847 100644
--- a/public/css/style.less
+++ b/public/css/style.less
@@ -854,4 +854,19 @@ a:hover, .btn-link:hover, .btn-link:active, .btn-link:focus {
margin-right: -11px;
}
-//END: FIXES FOR BS3, may need to remove these when we get out of the RC releases
+//END: FIXES FOR BS3, may need to remove these when we get out of the RC releases
+
+
+
+#pagination {
+ position: absolute;
+ background: rgb(34, 34, 34);
+ right: 0px;
+ top: 50px;
+ color: white;
+ padding: 10px;
+ padding-bottom: 5px;
+ padding-top: 5px;
+ font-size: 15px;
+ display: none;
+}
\ No newline at end of file
diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js
index a18fe6abce..bbd5617669 100644
--- a/public/src/ajaxify.js
+++ b/public/src/ajaxify.js
@@ -26,9 +26,12 @@ var ajaxify = {};
};
ajaxify.go = function(url, callback, template, quiet) {
+ // the following should be set like so: ajaxify.onchange(function(){}); where the code actually belongs
$(window).off('scroll');
- // leave room and join global
app.enter_room('global');
+ document.getElementById('pagination').style.display = 'none';
+ window.onscroll = null;
+
var url = url.replace(/\/$/, "");
diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js
index 7aa385bfa4..d3449c8fe6 100644
--- a/public/src/forum/topic.js
+++ b/public/src/forum/topic.js
@@ -608,15 +608,17 @@
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');
+ pagination.style.display = 'block';
+
+ var windowHeight = jQuery(window).height();
var scrollTop = jQuery(window).scrollTop();
- var scrollBottom = scrollTop + jQuery(window).height();
+ var scrollBottom = scrollTop + windowHeight;
if (scrollTop < 50) {
postAuthorImage.src = (jQuery('.main-avatar img').attr('src'));
@@ -649,8 +651,8 @@
}
});
- if (scrollTop >= jQuery(window).height()) {
- //pagination.innerHTML = postcount + ' / ' + postcount;
+ if(scrollTop + windowHeight == jQuery(document).height()) {
+ pagination.innerHTML = postcount + ' / ' + postcount;
}
}
diff --git a/public/templates/header.tpl b/public/templates/header.tpl
index cb9fe29f66..03dcd5863c 100644
--- a/public/templates/header.tpl
+++ b/public/templates/header.tpl
@@ -42,9 +42,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
- <a class="navbar-brand" href="/">{title}<div id="pagination">
- 0 / 0
- </div></a>
+ <a class="navbar-brand" href="/">{title}</a>
</div>
<div class="navbar-collapse collapse">
@@ -77,8 +75,8 @@
<button type="submit" class="btn hide">Search</button>
</form>
</li>
-
</ul>
+ <div id="pagination"></div>
</div>
</div>
</div>