X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/5bd864493e531e5600c5ca989825d89cc3ee1487..9bc86f5a6542c5893ac94284da33162a7c7be2d6:/src/catalogue/static/2022/book/filter.js diff --git a/src/catalogue/static/2022/book/filter.js b/src/catalogue/static/2022/book/filter.js deleted file mode 100644 index ac2674996..000000000 --- a/src/catalogue/static/2022/book/filter.js +++ /dev/null @@ -1,44 +0,0 @@ -(function($) { - - $(".quick-filter").each(function() { - let bookList = $('#' + $(this).data('for')); - let filterList = $('.' + $(this).data('filters')); - $(this).on('focus', function() { - filterList.addClass('filters-enabled'); - }); - $(this).on('blur', function() { - filterList.removeClass('filters-enabled'); - }); - $(this).on('input propertychange', function() { - let search = $(this).val().toLowerCase(); - bookList.children().each(function() { - found = !search || $("h2", this).text().toLowerCase().search(search) != -1; - if (found) - $(this).fadeIn(); - else - $(this).fadeOut(); - }); - }); - }); - - $(".l-books__sorting button").on('click', function() { - if ($(this).hasClass('is-active')) return; - $(".is-active", $(this).parent()).removeClass("is-active"); - $(this).addClass("is-active"); - let prop = $(this).attr('data-order'); - $(".l-books__item").css('opacity', '0'); - setTimeout(function() { - if (prop) { - $(".l-books__item").each(function() { - $(this).css('order', $(this).attr(prop)); - }); - } else { - $(".l-books__item").css('order', ''); - } - setTimeout(function() { - $(".l-books__item").css('opacity', '100%'); - }, 200); - }, 200); - }); - -})(jQuery);