From e10f7253039982f3f11750ed503fc1a1d9b17c40 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Tue, 9 Apr 2019 21:14:54 +0200 Subject: [PATCH] fix issue with table filter listening for wrong checkboxes --- static/js/utils/asyncTable.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/static/js/utils/asyncTable.js b/static/js/utils/asyncTable.js index 528ad1e1e..86bcd38fa 100644 --- a/static/js/utils/asyncTable.js +++ b/static/js/utils/asyncTable.js @@ -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); }); }