diff options
Diffstat (limited to 'install/ui/search.js')
-rw-r--r-- | install/ui/search.js | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/install/ui/search.js b/install/ui/search.js index ab3a1cea..a8f897ab 100644 --- a/install/ui/search.js +++ b/install/ui/search.js @@ -165,8 +165,10 @@ IPA.search_facet = function(spec) { that.show = function() { that.facet_show(); + var filter = IPA.nav.get_state(that.entity.name+'-filter'); + that.old_filter = filter || ''; + if (that.filter) { - var filter = IPA.nav.get_state(that.entity.name+'-filter'); that.filter.val(filter); } }; @@ -266,9 +268,8 @@ IPA.search_facet = function(spec) { var current_entity = entity; filter.unshift(IPA.nav.get_state(current_entity.name+'-filter')); current_entity = current_entity.get_containing_entity(); - while(current_entity !== null){ - filter.unshift( - IPA.nav.get_state(current_entity.name+'-pkey')); + while (current_entity !== null) { + filter.unshift(IPA.nav.get_state(current_entity.name+'-pkey')); current_entity = current_entity.get_containing_entity(); } @@ -286,6 +287,17 @@ IPA.search_facet = function(spec) { command.execute(); }; + that.clear = function() { + if(that.needs_clear()) { + that.table.clear(); + } + }; + + that.needs_clear = function() { + var filter = IPA.nav.get_state(that.entity.name+'-filter') || ''; + return that.old_filter !== '' || that.old_filter !== filter; + }; + // methods that should be invoked by subclasses that.search_facet_create_content = that.create_content; |