mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 16:36:15 -04:00
/admin/plugins: Fix infinite scroll for larger screens
This commit is contained in:
parent
2393dcd652
commit
4edb3b7ab3
1 changed files with 11 additions and 7 deletions
|
@ -75,6 +75,16 @@ $(document).ready(function () {
|
|||
})
|
||||
}
|
||||
|
||||
// Infinite scroll
|
||||
$(window).scroll(checkInfiniteScroll)
|
||||
function checkInfiniteScroll() {
|
||||
if(search.end) return;// don't keep requesting if there are no more results
|
||||
try{
|
||||
var top = $('.search-results .results > tr:last').offset().top
|
||||
if($(window).scrollTop()+$(window).height() > top) search(search.searchTerm)
|
||||
}catch(e){}
|
||||
}
|
||||
|
||||
function updateHandlers() {
|
||||
// Search
|
||||
$("#search-query").unbind('keyup').keyup(function () {
|
||||
|
@ -102,13 +112,6 @@ $(document).ready(function () {
|
|||
})
|
||||
});
|
||||
|
||||
// Infinite scroll
|
||||
$(window).unbind('scroll').scroll(function() {
|
||||
if(search.end) return;// don't keep requesting if there are no more results
|
||||
var top = $('.search-results .results > tr:last').offset().top
|
||||
if($(window).scrollTop()+$(window).height() > top) search(search.searchTerm)
|
||||
})
|
||||
|
||||
// Sort
|
||||
$('.sort.up').unbind('click').click(function() {
|
||||
search.sortBy = $(this).text().toLowerCase();
|
||||
|
@ -154,6 +157,7 @@ $(document).ready(function () {
|
|||
$(".search-results .nothing-found").show()
|
||||
}
|
||||
$('#search-progress').hide()
|
||||
checkInfiniteScroll()
|
||||
});
|
||||
|
||||
socket.on('results:installed', function (data) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue