summaryrefslogtreecommitdiffstats
path: root/install/ui/search.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2011-10-24 14:53:29 +0200
committerEndi S. Dewata <edewata@redhat.com>2011-11-02 15:37:49 +0000
commit9afe4b98da13bbf1ce2fd68a660ee1d77fd84f2f (patch)
tree76ddd647312cda21d55d8da0189e0b6321013d96 /install/ui/search.js
parent237a021848dd3a1e4716971ae907910e1cbfbc8e (diff)
downloadfreeipa-9afe4b98da13bbf1ce2fd68a660ee1d77fd84f2f.tar.gz
freeipa-9afe4b98da13bbf1ce2fd68a660ee1d77fd84f2f.tar.xz
freeipa-9afe4b98da13bbf1ce2fd68a660ee1d77fd84f2f.zip
Page is cleared before it is visible
https://fedorahosted.org/freeipa/ticket/1459 Changes: * added clear method to widgets, section, search, details, association facets * clear and refresh method in facet are called only if key/filter was changed * added id generator for widgets
Diffstat (limited to 'install/ui/search.js')
-rw-r--r--install/ui/search.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/install/ui/search.js b/install/ui/search.js
index ab3a1cea4..a8f897ab5 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;