Merge branch 'develop' of github.com:ether/etherpad-lite into develop

pull/2467/head
John McLear 2015-01-18 23:17:06 +00:00
commit ce41bcea2f
1 changed files with 2 additions and 27 deletions

View File

@ -26,12 +26,11 @@ $(document).ready(function () {
$('#search-progress').show() $('#search-progress').show()
search.messages.show('fetching') search.messages.show('fetching')
storeScrollPosition()
search.searching = true search.searching = true
} }
search.searching = false; search.searching = false;
search.offset = 0; search.offset = 0;
search.limit = 25; search.limit = 999;
search.results = []; search.results = [];
search.sortBy = 'name'; search.sortBy = 'name';
search.sortDir = /*DESC?*/true; search.sortDir = /*DESC?*/true;
@ -43,7 +42,7 @@ $(document).ready(function () {
$('.search-results .messages .'+msg+' *').show() $('.search-results .messages .'+msg+' *').show()
}, },
hide: function(msg) { hide: function(msg) {
//$('.search-results .messages').hide() $('.search-results .messages').hide()
$('.search-results .messages .'+msg+'').hide() $('.search-results .messages .'+msg+'').hide()
$('.search-results .messages .'+msg+' *').hide() $('.search-results .messages .'+msg+' *').hide()
} }
@ -104,28 +103,6 @@ $(document).ready(function () {
}) })
} }
// Infinite scroll
var scrollPosition
function storeScrollPosition() {
scrollPosition = $(window).scrollTop()
}
function restoreScrollPosition() {
setTimeout(function() {
$(window).scrollTop(scrollPosition)
}, 0)
}
$(window).scroll(checkInfiniteScroll)
function checkInfiniteScroll() {
if(search.end || search.searching) return;// don't keep requesting if there are no more results
setTimeout(function() {
try{
var top = $('.results>tr:last').offset().top
if($(window).scrollTop()+$(window).height() > top) search(search.searchTerm)
}catch(e){}
}, 1)
}
function updateHandlers() { function updateHandlers() {
// Search // Search
$("#search-query").unbind('keyup').keyup(function () { $("#search-query").unbind('keyup').keyup(function () {
@ -209,8 +186,6 @@ $(document).ready(function () {
} }
search.messages.hide('fetching') search.messages.hide('fetching')
$('#search-progress').hide() $('#search-progress').hide()
restoreScrollPosition()
checkInfiniteScroll()
search.searching = false search.searching = false
}); });