fix issue with table filter listening for wrong checkboxes

This commit is contained in:
Felix Hamann 2019-04-09 21:14:54 +02:00
parent 2a311917b3
commit e10f725303

View File

@ -128,28 +128,28 @@
}
function setupTableFilter() {
var filterForm = element.querySelector(ASYNC_TABLE_FILTER_FORM_SELECTOR);
var tableFilterForm = element.querySelector(ASYNC_TABLE_FILTER_FORM_SELECTOR);
if (filterForm) {
gatherTableFilterInputs();
if (tableFilterForm) {
gatherTableFilterInputs(tableFilterForm);
addTableFilterEventListeners();
}
}
function gatherTableFilterInputs() {
Array.from(element.querySelectorAll('input[type="search"]')).forEach(function(input) {
function gatherTableFilterInputs(tableFilterForm) {
Array.from(tableFilterForm.querySelectorAll('input[type="search"]')).forEach(function(input) {
tableFilterInputs.search.push(input);
});
Array.from(element.querySelectorAll('input[type="text"]')).forEach(function(input) {
Array.from(tableFilterForm.querySelectorAll('input[type="text"]')).forEach(function(input) {
tableFilterInputs.input.push(input);
});
Array.from(element.querySelectorAll('input:not([type="text"]):not([type="search"])')).forEach(function(input) {
Array.from(tableFilterForm.querySelectorAll('input:not([type="text"]):not([type="search"])')).forEach(function(input) {
tableFilterInputs.change.push(input);
});
Array.from(element.querySelectorAll('select')).forEach(function(input) {
Array.from(tableFilterForm.querySelectorAll('select')).forEach(function(input) {
tableFilterInputs.select.push(input);
});
}