From 2f3281d44784bfc20651ee7b69f77ded122d80c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= Date: Thu, 19 Feb 2015 11:57:24 +0000 Subject: [PATCH] rrs: UI add clear search button in Recipes and Maintainers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This enables the user to clear current search content and restore the orginial status. Signed-off-by: Aníbal Limón --- templates/rrs/maintainers.html | 17 ++++++++++++++--- templates/rrs/recipes.html | 19 ++++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/templates/rrs/maintainers.html b/templates/rrs/maintainers.html index e52f3c7..444aaab 100644 --- a/templates/rrs/maintainers.html +++ b/templates/rrs/maintainers.html @@ -24,8 +24,11 @@ - @@ -156,10 +159,18 @@ $(document).ready(function() { event.preventDefault(); }); - $("#view-all-maintainers").click(function() { + function clearSearch() { $.uiTableFilter(statisticsTable, ''); $("#filter").val('') updateMaintainerCount() + } + + $("#view-all-maintainers").click(function() { + clearSearch() + }); + + $("#clear-search-btn").click(function() { + clearSearch() }); {% if maintainer_count > 0 %} diff --git a/templates/rrs/recipes.html b/templates/rrs/recipes.html index c3719a1..390e422 100644 --- a/templates/rrs/recipes.html +++ b/templates/rrs/recipes.html @@ -56,8 +56,11 @@ - @@ -262,14 +265,24 @@ $(document).ready(function() { updateRecipeCount() }); - $("#view-all-recipes").click(function() { + function clearSearch() { upstreamStatus = 'All' maintainer = 'All' applyFilters() $("#filter").val('') updateRecipeCount() + } + + $("#view-all-recipes").click(function() { + clearSearch() }); + $("#clear-search-btn").click(function() { + clearSearch() + }); + + $(".icon-remove").tooltip( {container: 'body', html: true, title: "Clear search" }); + {% if recipe_list_count > 0 %} $(recipesTable).tablesorter({ sortList: [[0,0], [3,0], [4,0]],