Use $.attr() for reading data-tags value, as $.data() can do unwanted conversions. Fixes #161

This commit is contained in:
Pēteris Caune 2018-03-13 08:03:31 +02:00
parent 7cd33188ab
commit 61191d1cb9

View File

@ -211,7 +211,9 @@ $(function () {
} }
function applyFilters(index, element) { 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++) { for (var i=0, tag; tag=checked[i]; i++) {
if (tags.indexOf(tag) == -1) { if (tags.indexOf(tag) == -1) {
$(element).hide(); $(element).hide();