From 61191d1cb94734a630cde8915cf2bc0bf7d91164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Tue, 13 Mar 2018 08:03:31 +0200 Subject: [PATCH] Use $.attr() for reading data-tags value, as $.data() can do unwanted conversions. Fixes #161 --- static/js/checks.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/checks.js b/static/js/checks.js index b1c0fc02..79ec8b6d 100644 --- a/static/js/checks.js +++ b/static/js/checks.js @@ -211,7 +211,9 @@ $(function () { } function applyFilters(index, element) { - var tags = $(".my-checks-name", element).data("tags").split(" "); + // use attr(), as data() tries converting strings to JS types: + // (e.g., "123" -> 123) + var tags = $(".my-checks-name", element).attr("data-tags").split(" "); for (var i=0, tag; tag=checked[i]; i++) { if (tags.indexOf(tag) == -1) { $(element).hide();