From 724dbf7c97cbc07fc9a151267c3e45c23dc2f1e2 Mon Sep 17 00:00:00 2001 From: jwollert Date: Thu, 17 Feb 2011 12:02:18 +0100 Subject: [PATCH] fix filter setting/unsetting. the input value has to be manually set/unset when adding/removing filters. --- assets/javascripts/reporting/filters.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/reporting/filters.js b/assets/javascripts/reporting/filters.js index fc21c64044..02d4b2d4d5 100644 --- a/assets/javascripts/reporting/filters.js +++ b/assets/javascripts/reporting/filters.js @@ -44,13 +44,15 @@ Reporting.Filters = { var field_el = $('tr_' + field); if (field_el !== null) { // the following command might be included into the callback_function (which is called after the ajax request) later - $('rm_' + field).value = field; var display_functor; if (options.show_filter) { display_functor = options.slowly ? Effect.Appear : Element.show; Reporting.Filters.load_available_values_for_filter(field, options.callback_func); + $('rm_' + field).value = field; // set the value, so the serialized form will return this filter } else { display_functor = options.slowly ? Effect.Fade : Element.hide; + field_el.removeAttribute('data-selected'); + $('rm_' + field).value = ""; // reset the value, so the serialized form will not return this filter } display_functor(field_el); Reporting.Filters.operator_changed(field, $("operators_" + field));