finished pagination for topic view

v1.18.x
psychobunny 12 years ago
parent 469a5221ed
commit 2098bf84a1

@ -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;
}

@ -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(/\/$/, "");

@ -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;
}
}

@ -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>

Loading…
Cancel
Save