From dd191cf97d22e3735feb473374609472728503c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Fri, 13 Dec 2013 20:53:40 +0100 Subject: [PATCH] Correctly filter books with no tags. re #109 --- util.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/util.js b/util.js index 700a060..988d339 100644 --- a/util.js +++ b/util.js @@ -188,6 +188,18 @@ function doFilter () { } if (toBeFiltered) { $(this).parents (".books").addClass ("filtered"); } }); + + // Handle the books with no tags + var atLeastOneTagSelected = false; + for (var filter in filterList) { + if (filterList [filter] === true) { + atLeastOneTagSelected = true; + } + } + if (atLeastOneTagSelected) { + $(".books").not (":has(span.se)").addClass ("filtered"); + } + updateFilters (); }