diff options
| author | luccioman <luccioman@users.noreply.github.com> | 2017-09-13 07:41:03 +0200 |
|---|---|---|
| committer | luccioman <luccioman@users.noreply.github.com> | 2017-09-13 07:41:03 +0200 |
| commit | 4ccd38357f82f63a5644701cf80091e646dda52a (patch) | |
| tree | 0f3ff45a6ff6c9ac298781353bb3da9d539b5c3b /htroot/js | |
| parent | e40a225bc1e3e7acf7b9d705320506bba21f5510 (diff) | |
Trigger js resorting animations using only CSS classes.
Also added some more descriptive comments.
Diffstat (limited to 'htroot/js')
| -rw-r--r-- | htroot/js/yacysort.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/htroot/js/yacysort.js b/htroot/js/yacysort.js index 3b18b4a03..d20281fde 100644 --- a/htroot/js/yacysort.js +++ b/htroot/js/yacysort.js @@ -12,20 +12,19 @@ var displayPage = function() { $("#resultscontainer").find(".searchresults.earlierpage").each( function(i) { // Hide the item $(this).removeClass("currentpage"); - $(this).css('animation', '1s 1 forwards hide'); }); // For every search item from a current or later page... $("#resultscontainer").find(".searchresults:not(.earlierpage)").each( function(i) { + var laterPage = (i >= requestedResults); + $(this).toggleClass("laterpage", laterPage); // If we now have too many results, hide the lowest-ranking ones. - if (i >= requestedResults) { + if (laterPage) { $(this).removeClass("currentpage"); - $(this).css('animation', '1s 1 forwards hide'); } else { + $(this).removeClass("hidden"); $(this).addClass("currentpage"); - $(this).css('display', ''); - $(this).css('animation', '1s 1 forwards show'); } }); @@ -272,7 +271,8 @@ var updateSidebar = function() { }; var processItem = function(data) { - var newItem = $(data).hide(); + var newItem = $(data); + newItem.addClass("hidden"); // If we didn't get a valid response from YaCy, wait 1 second and try again. if( ! newItem.data("ranking") ) { |
