Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id B644BE00B83; Fri, 18 Dec 2015 01:24:33 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [134.134.136.24 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 70661E00C42 for ; Fri, 18 Dec 2015 01:24:21 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 18 Dec 2015 01:24:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,445,1444719600"; d="scan'208";a="620057379" Received: from agusev-mobl2.ger.corp.intel.com (HELO lp.ger.corp.intel.com) ([10.252.27.121]) by FMSMGA003.fm.intel.com with ESMTP; 18 Dec 2015 01:24:20 -0800 From: Elliot Smith To: toaster@yoctoproject.org Date: Fri, 18 Dec 2015 09:23:51 +0000 Message-Id: <1450430639-14995-10-git-send-email-elliot.smith@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1450430639-14995-1-git-send-email-elliot.smith@intel.com> References: <1450430639-14995-1-git-send-email-elliot.smith@intel.com> Subject: [review-request][PATCH 09/17] toaster: toastergui Switch off filter highlights when inactive X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 09:24:33 -0000 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] Signed-off-by: Elliot Smith --- bitbake/lib/toaster/toastergui/static/js/table.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js index fa01ddf..63f8a1f 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]); -- Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.