From b58c504ee973c8dffae864a442f05866fce7d66a Mon Sep 17 00:00:00 2001 From: Aníbal Limón Date: Mon, 23 Feb 2015 07:55:23 +0000 Subject: templates/rrs: Recipes and Maintainers UI search improvments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Display button without btn-info to give consistency in the UI. Don't display clear search button when search isn't active. Signed-off-by: Aníbal Limón --- templates/rrs/maintainers.html | 6 ++++-- templates/rrs/recipes.html | 30 +++++++++++++++--------------- 2 files changed, 19 insertions(+), 17 deletions(-) (limited to 'templates') diff --git a/templates/rrs/maintainers.html b/templates/rrs/maintainers.html index 1386e65f70..a3180ff05e 100644 --- a/templates/rrs/maintainers.html +++ b/templates/rrs/maintainers.html @@ -26,10 +26,10 @@ @@ -156,11 +156,13 @@ $(document).ready(function() { search_text = $("#filter").val() $.uiTableFilter(statisticsTable, search_text); updateMaintainerCount() + $("#clear-search-btn").show() event.preventDefault(); }); function clearSearch() { $.uiTableFilter(statisticsTable, ''); + $("#clear-search-btn").hide() $("#filter").val('') updateMaintainerCount() } diff --git a/templates/rrs/recipes.html b/templates/rrs/recipes.html index ac673f705b..493b7cf904 100644 --- a/templates/rrs/recipes.html +++ b/templates/rrs/recipes.html @@ -58,10 +58,10 @@ @@ -245,39 +245,39 @@ $(document).ready(function() { upstreamStatus = 'All' maintainer = 'All' search_text = $("#filter").val() + $("#clear-search-btn").show() applyFilters() $.uiTableFilter(recipesTable, search_text); updateRecipeCount() event.preventDefault(); }); - $("#select-status a").click(function() { - upstreamStatus = this.text - applyFilters() + function clearSearch() { $("#filter").val('') + $("#clear-search-btn").hide() + applyFilters() updateRecipeCount() + } + + $("#select-status a").click(function() { + upstreamStatus = this.text + clearSearch() }); $("#select-maintainer a").click(function() { maintainer = this.text - applyFilters() - $("#filter").val('') - updateRecipeCount() + clearSearch() }); - function clearSearch() { + $("#view-all-recipes").click(function() { upstreamStatus = 'All' maintainer = 'All' - applyFilters() - $("#filter").val('') - updateRecipeCount() - } - - $("#view-all-recipes").click(function() { clearSearch() }); $("#clear-search-btn").click(function() { + upstreamStatus = 'All' + maintainer = 'All' clearSearch() }); -- cgit 1.2.3-korg