diff options
Diffstat (limited to 'modules-available/statistics/templates/filterbox.html')
-rw-r--r-- | modules-available/statistics/templates/filterbox.html | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/modules-available/statistics/templates/filterbox.html b/modules-available/statistics/templates/filterbox.html index e7c1cd9b..f62c4d7c 100644 --- a/modules-available/statistics/templates/filterbox.html +++ b/modules-available/statistics/templates/filterbox.html @@ -106,47 +106,23 @@ document.addEventListener("DOMContentLoaded", function () { e.find('.filter-val').each(function(idx, elem) { var e = $(elem); var val = e.data('filter-val'); + var op = e.data('filter-op'); + if (!op) op = '='; if (val === null || val === undefined) return; e.click(function(ev) { ev.preventDefault(); - addFilter(col, '=', val); + addFilter(col, op, val); refresh(); }); }); }); + $('.auto-chart').each(function() { + makePieChart($(this)); + }); + }, false); -function popupFilter(field) { - var $row = addFilter(field, null, null); - if ($row !== null) { - $row.find('.arg').focus(); - $row.removeClass('slx-focus') - setTimeout(function() { $row.addClass('slx-focus'); }, 10); - } -} - -function addFilter(field, op, argument) { - if (field === null) - return null; - var $row = $('#filter-' + field); - if ($row.length === 0) - return null; - if (argument !== null) { - $row.find('.op').val(op); - $row.find('.arg').val(argument); - } - // Enable checkbox only if we got a predefined value, or if argument is in a select, as the user might want the preselected item and doesn't notice the checkbox is unchecked - if (argument !== null || $row.find('select.arg').length !== 0) { - $row.find('.filter-enable').prop('checked', true); - } - $row.show(); - return $row; -} - -function refresh() { - $('#query-form').submit(); -} // --></script> |