From 6abbd2bf9a0dafa93e92928a269820eaa127b12b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 29 Jul 2016 12:18:36 +0200 Subject: [statistics] Make filtering more dynamic, remove hard cutoff from summary --- modules-available/statistics/templates/filterbox.html | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'modules-available/statistics/templates/filterbox.html') diff --git a/modules-available/statistics/templates/filterbox.html b/modules-available/statistics/templates/filterbox.html index 2e7928e9..a8a36adb 100644 --- a/modules-available/statistics/templates/filterbox.html +++ b/modules-available/statistics/templates/filterbox.html @@ -99,7 +99,8 @@ document.addEventListener("DOMContentLoaded", function () { /* initialize selectize */ filterSelectize = $('#filterInput').selectize({ delimiter: slxFilterDel, - plugins: ['restore_on_backspace', 'remove_button'], + persist: false, + plugins: ['remove_button'], create: function(input) { return {value: input, text: input} }, @@ -156,6 +157,22 @@ document.addEventListener("DOMContentLoaded", function () { initButtons(); + $('.filter-col').each(function(idx, elem) { + var e = $(elem); + var col = e.data('filter-col'); + if (!col) return; + e.find('.filter-val').each(function(idx, elem) { + var e = $(elem); + var val = e.data('filter-val'); + if (!val) return; + e.click(function(ev) { + ev.preventDefault(); + addFilter(col, '=', val); + refresh(); + }); + }); + }); + }, false); -- cgit v1.2.3-55-g7522