diff --git a/www/assets/js/callbacks.js b/www/assets/js/callbacks.js index e4b966ee..549a81c9 100644 --- a/www/assets/js/callbacks.js +++ b/www/assets/js/callbacks.js @@ -692,21 +692,26 @@ Callbacks = { }, librarySearchResults: function(data) { - var n = $("#library").children().length; - for(var i = 0; i < n; i++) { - $("#library")[0].removeChild($("#library").children()[0]); - } - var ul = $("#library")[0]; - for(var i = 0; i < data.results.length; i++) { - var li = makeQueueEntry(data.results[i]); - if(RANK >= Rank.Moderator || OPENQUEUE || LEADER) { - if(data.results[i].thumb) - addLibraryButtons(li, data.results[i].id, true); - else - addLibraryButtons(li, data.results[i].id); + clearSearchResults(); + $("#library").data("entries", data.results); + if(data.results.length > 100) { + var pag = $("
").addClass("pagination") + .attr("id", "search_pagination") + .insertAfter($("#library")); + var btns = $("