mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 06:25:50 +01:00
moved paginator progress bar into paginator block, better mobile handling, and hiding it on page load
This commit is contained in:
@@ -29,7 +29,7 @@ var ajaxify = {};
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var pagination;
|
var pagination, paginator_bar;
|
||||||
|
|
||||||
ajaxify.go = function (url, callback, template, quiet) {
|
ajaxify.go = function (url, callback, template, quiet) {
|
||||||
// start: the following should be set like so: ajaxify.onchange(function(){}); where the code actually belongs
|
// start: the following should be set like so: ajaxify.onchange(function(){}); where the code actually belongs
|
||||||
@@ -37,8 +37,10 @@ var ajaxify = {};
|
|||||||
app.enterRoom('global');
|
app.enterRoom('global');
|
||||||
|
|
||||||
pagination = pagination || document.getElementById('pagination');
|
pagination = pagination || document.getElementById('pagination');
|
||||||
|
paginator_bar = pagination ? document.body.querySelector('.progress-container') : undefined;
|
||||||
if (pagination) {
|
if (pagination) {
|
||||||
pagination.parentNode.style.display = 'none';
|
pagination.parentNode.style.display = 'none';
|
||||||
|
paginator_bar.style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onscroll = null;
|
window.onscroll = null;
|
||||||
|
|||||||
@@ -789,12 +789,14 @@ define(function() {
|
|||||||
}
|
}
|
||||||
pagination = pagination || document.getElementById('pagination');
|
pagination = pagination || document.getElementById('pagination');
|
||||||
|
|
||||||
pagination.parentNode.style.display = 'block';
|
|
||||||
|
|
||||||
var windowHeight = jQuery(window).height();
|
var windowHeight = jQuery(window).height();
|
||||||
var scrollTop = jQuery(window).scrollTop();
|
var scrollTop = jQuery(window).scrollTop();
|
||||||
var scrollBottom = scrollTop + windowHeight;
|
var scrollBottom = scrollTop + windowHeight;
|
||||||
var progressBar = $('.progress-bar');
|
var progressBar = $('.progress-bar');
|
||||||
|
var progressBarContainer = $('.progress-container');
|
||||||
|
|
||||||
|
pagination.parentNode.style.display = 'block';
|
||||||
|
progressBarContainer.css('display', '');
|
||||||
|
|
||||||
if (scrollTop < 50 && Topic.postCount > 1) {
|
if (scrollTop < 50 && Topic.postCount > 1) {
|
||||||
localStorage.removeItem("topic:" + tid + ":bookmark");
|
localStorage.removeItem("topic:" + tid + ":bookmark");
|
||||||
|
|||||||
@@ -140,10 +140,10 @@
|
|||||||
<i class="fa fa-chevron-up pointer"></i>
|
<i class="fa fa-chevron-up pointer"></i>
|
||||||
<span id="pagination"></span>
|
<span id="pagination"></span>
|
||||||
<i class="fa fa-chevron-down pointer"></i>
|
<i class="fa fa-chevron-down pointer"></i>
|
||||||
</a>
|
|
||||||
<div class="progress-container">
|
<div class="progress-container">
|
||||||
<div class="progress-bar"></div>
|
<div class="progress-bar"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user