consider upper dependent-chain when narrowing values

pull/6827/head
Philipp Tessenow 14 years ago
parent d256a09905
commit 3d3963a9e9
  1. 12
      assets/javascripts/reporting/filters.js

@ -286,10 +286,20 @@ Reporting.Filters = {
var active_dependents = all_dependents.select(function (d) { var active_dependents = all_dependents.select(function (d) {
return active_filters.include(d); return active_filters.include(d);
}); });
Reporting.Filters.narrow_values([source], active_dependents, callbackWhenFinished); Reporting.Filters.narrow_values(Reporting.Filters.dependent_for(source), active_dependents, callbackWhenFinished);
}, 1); }, 1);
}, },
// return an array of all filters that depend on the given filter plus the given filter
dependent_for: function(field) {
var deps = $$('.filters-select[data-all-dependents]').findAll(function(selectBox) {
return Reporting.Filters.get_dependents(selectBox).include(field)
}).map(function(selectBox) {
return selectBox.getAttribute("data-filter-name");
});
return deps === undefined ? [ field ] : [ field ].concat(deps)
},
// Select the given values of the selectBox. // Select the given values of the selectBox.
// Toggle multi-select state of the selectBox depending on how many values were given. // Toggle multi-select state of the selectBox depending on how many values were given.
select_values: function(selectBox, values_to_select) { select_values: function(selectBox, values_to_select) {

Loading…
Cancel
Save