mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
pagination scroll block fix + cleanup
This commit is contained in:
@@ -615,6 +615,15 @@
|
||||
var postcount = templates.get('postcount');
|
||||
|
||||
function updateHeader() {
|
||||
if (pagination == null) {
|
||||
jQuery('.pagination-block i:first').on('click', function() {
|
||||
app.scrollToTop();
|
||||
});
|
||||
jQuery('.pagination-block i:last').on('click', function() {
|
||||
app.scrollToBottom();
|
||||
});
|
||||
}
|
||||
|
||||
jQuery('.post-author-info').css('bottom', '0px');
|
||||
postAuthorImage = postAuthorImage || document.getElementById('post-author-image');
|
||||
postAuthorInfo = postAuthorInfo || document.getElementById('post-author-info');
|
||||
@@ -651,7 +660,7 @@
|
||||
|
||||
|
||||
if (inView) {
|
||||
pagination.innerHTML = this.postnumber + ' / ' + postcount;
|
||||
pagination.innerHTML = this.postnumber + ' out of ' + 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();
|
||||
}
|
||||
@@ -659,7 +668,7 @@
|
||||
|
||||
setTimeout(function() {
|
||||
if(scrollTop + windowHeight == jQuery(document).height()) {
|
||||
pagination.innerHTML = postcount + ' / ' + postcount;
|
||||
pagination.innerHTML = postcount + ' out of ' + postcount;
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
@@ -83,9 +83,9 @@
|
||||
</ul>
|
||||
|
||||
<div class="pagination-block">
|
||||
<i class="icon-upload pointer" onclick="app.scrollToTop()"></i>
|
||||
<i class="icon-upload pointer"></i>
|
||||
<span id="pagination"></span>
|
||||
<i class="icon-upload pointer icon-rotate-180" onclick="app.scrollToBottom()"></i>
|
||||
<i class="icon-upload pointer icon-rotate-180"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user