Browse Source

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

pull/163/head
Pēteris Caune 7 years ago
parent
commit
61191d1cb9
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      static/js/checks.js

+ 3
- 1
static/js/checks.js View File

@ -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();


Loading…
Cancel
Save