mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
finished pagination for topic view
This commit is contained in:
@@ -854,4 +854,19 @@ a:hover, .btn-link:hover, .btn-link:active, .btn-link:focus {
|
|||||||
margin-right: -11px;
|
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) {
|
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');
|
$(window).off('scroll');
|
||||||
// leave room and join global
|
|
||||||
app.enter_room('global');
|
app.enter_room('global');
|
||||||
|
document.getElementById('pagination').style.display = 'none';
|
||||||
|
window.onscroll = null;
|
||||||
|
|
||||||
|
|
||||||
var url = url.replace(/\/$/, "");
|
var url = url.replace(/\/$/, "");
|
||||||
|
|
||||||
|
|||||||
@@ -608,15 +608,17 @@
|
|||||||
var postAuthorImage, postAuthorInfo, pagination;
|
var postAuthorImage, postAuthorInfo, pagination;
|
||||||
var postcount = templates.get('postcount');
|
var postcount = templates.get('postcount');
|
||||||
|
|
||||||
|
|
||||||
function updateHeader() {
|
function updateHeader() {
|
||||||
jQuery('.post-author-info').css('bottom', '0px');
|
jQuery('.post-author-info').css('bottom', '0px');
|
||||||
postAuthorImage = postAuthorImage || document.getElementById('post-author-image');
|
postAuthorImage = postAuthorImage || document.getElementById('post-author-image');
|
||||||
postAuthorInfo = postAuthorInfo || document.getElementById('post-author-info');
|
postAuthorInfo = postAuthorInfo || document.getElementById('post-author-info');
|
||||||
pagination = pagination || document.getElementById('pagination');
|
pagination = pagination || document.getElementById('pagination');
|
||||||
|
|
||||||
|
pagination.style.display = 'block';
|
||||||
|
|
||||||
|
var windowHeight = jQuery(window).height();
|
||||||
var scrollTop = jQuery(window).scrollTop();
|
var scrollTop = jQuery(window).scrollTop();
|
||||||
var scrollBottom = scrollTop + jQuery(window).height();
|
var scrollBottom = scrollTop + windowHeight;
|
||||||
|
|
||||||
if (scrollTop < 50) {
|
if (scrollTop < 50) {
|
||||||
postAuthorImage.src = (jQuery('.main-avatar img').attr('src'));
|
postAuthorImage.src = (jQuery('.main-avatar img').attr('src'));
|
||||||
@@ -649,8 +651,8 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (scrollTop >= jQuery(window).height()) {
|
if(scrollTop + windowHeight == jQuery(document).height()) {
|
||||||
//pagination.innerHTML = postcount + ' / ' + postcount;
|
pagination.innerHTML = postcount + ' / ' + postcount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,9 +42,7 @@
|
|||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
<a class="navbar-brand" href="/">{title}<div id="pagination">
|
<a class="navbar-brand" href="/">{title}</a>
|
||||||
0 / 0
|
|
||||||
</div></a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="navbar-collapse collapse">
|
<div class="navbar-collapse collapse">
|
||||||
@@ -77,8 +75,8 @@
|
|||||||
<button type="submit" class="btn hide">Search</button>
|
<button type="submit" class="btn hide">Search</button>
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
<div id="pagination"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user