From 829271417eb9d9c6c53e8c6a293fd7e33af03384 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Mon, 7 Mar 2016 23:02:24 -0500 Subject: [PATCH] Fixing bug in filter_box --- panoramix/assets/.eslintrc | 2 +- panoramix/assets/visualizations/filter_box.js | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/panoramix/assets/.eslintrc b/panoramix/assets/.eslintrc index 66a04af5c424c..882ad973a86e3 100644 --- a/panoramix/assets/.eslintrc +++ b/panoramix/assets/.eslintrc @@ -58,7 +58,7 @@ "max-depth": [2, 5], "max-len": [0, 80, 4], "max-nested-callbacks": [1, 2], - "max-params": [1, 3], + "max-params": [1, 4], "new-parens": [2], "newline-after-var": [0], "no-bitwise": [0], diff --git a/panoramix/assets/visualizations/filter_box.js b/panoramix/assets/visualizations/filter_box.js index dd833a08b4c54..f4714b4637bbc 100644 --- a/panoramix/assets/visualizations/filter_box.js +++ b/panoramix/assets/visualizations/filter_box.js @@ -7,21 +7,17 @@ var d3 = window.d3 || require('d3'); require('./filter_box.css'); require('../javascripts/panoramix-select2.js'); - function filterBox(slice) { var filtersObj = {}; var d3token = d3.select(slice.selector); var fltChanged = function () { - for (var filter in filtersObj) { - var obj = filtersObj[filter]; - var val = obj.val(); - var vals = []; - if (val !== '') { - vals = val.split(','); - } - slice.setFilter(filter, vals); + var val = $(this).val(); + var vals = []; + if (val !== '') { + vals = val.split(','); } + slice.setFilter($(this).attr('name'), vals); }; var refresh = function () {