From 1a4b203ca59bcf953b030dc582e298ce13cf3470 Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Fri, 15 Jan 2016 13:00:51 +0200 Subject: bitbake: toastergui: switch off filter highlights when inactive In ToasterTables with multiple columns which allow filtering (e.g. all builds), selecting one filter, then a second filter (e.g. selecting "failed builds" then "outcome" for all builds), would result in both filters being highlighted at the same time. Fix this by removing the "active" highlight on all column filter buttons when a new filter value is submitted (via the filter modal). NB to enable this, added a data-filter-on attribute to all column filter buttons to make them easy to select. [YOCTO #8738] (Bitbake rev: 7347ad0d4baace593751b44a86ab8e11a04a02b6) Signed-off-by: Elliot Smith Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/table.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bitbake') diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js index fa01ddf47e..63f8a1fed7 100644 --- a/bitbake/lib/toaster/toastergui/static/js/table.js +++ b/bitbake/lib/toaster/toastergui/static/js/table.js @@ -248,7 +248,7 @@ function tableInit(ctx){ /* Setup the filter button */ if (col.filter_name){ - var filterBtn = $(''); + var filterBtn = $(''); filterBtn.data('filter-name', col.filter_name); filterBtn.prop('id', col.filter_name); @@ -565,6 +565,12 @@ function tableInit(ctx){ $("#filter-modal-form-"+ctx.tableName).submit(function(e){ e.preventDefault(); + /* remove active status from all filter buttons so that only one filter + can be active at a time */ + $('[data-filter-on]').each(function (index, filterBtn) { + filterBtnActive($(filterBtn), false); + }); + tableParams.filter = $(this).find("input[type='radio']:checked").val(); var filterBtn = $("#" + tableParams.filter.split(":")[0]); -- cgit v1.2.3-54-g00ecf