summaryrefslogtreecommitdiffstats
path: root/install/ui/association.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-07-21 18:50:32 -0500
committerAdam Young <ayoung@redhat.com>2011-07-22 12:29:55 -0400
commit740bacdfb9b7258a21669873efbd7639aebbdd71 (patch)
tree32767b60aec65847faa8c48dec75ea26f602bcf2 /install/ui/association.js
parent38ed284054a0d2e436f8a2717faceabec7e996ab (diff)
downloadfreeipa-740bacdfb9b7258a21669873efbd7639aebbdd71.tar.gz
freeipa-740bacdfb9b7258a21669873efbd7639aebbdd71.tar.xz
freeipa-740bacdfb9b7258a21669873efbd7639aebbdd71.zip
Fixed navigation problems.
The navigation code has been modified store the facet's state separately in the facet object itself. The path state is stored in the navigation object. When the path is changed to view a new facet, only the path and the state of the new facet will be shown in the URL, thus keeping the URL short. This fixes pagination, bookmark and search filter problems as well. Ticket #1507, 1516, 1517
Diffstat (limited to 'install/ui/association.js')
-rw-r--r--install/ui/association.js21
1 files changed, 15 insertions, 6 deletions
diff --git a/install/ui/association.js b/install/ui/association.js
index 5354117d0..9f315a0e1 100644
--- a/install/ui/association.js
+++ b/install/ui/association.js
@@ -762,13 +762,17 @@ IPA.association_facet = function (spec) {
that.table.prev_page = function() {
if (that.table.current_page > 1) {
- IPA.nav.push_state({ page: that.table.current_page-1 });
+ var state = {};
+ state[that.entity_name+'-page'] = that.table.current_page - 1;
+ IPA.nav.push_state(state);
}
};
that.table.next_page = function() {
if (that.table.current_page < that.table.total_pages) {
- IPA.nav.push_state({ page: that.table.current_page+1 });
+ var state = {};
+ state[that.entity_name+'-page'] = that.table.current_page + 1;
+ IPA.nav.push_state(state);
}
};
@@ -778,16 +782,21 @@ IPA.association_facet = function (spec) {
} else if (page > that.total_pages) {
page = that.total_pages;
}
- IPA.nav.push_state({ page: page });
+ var state = {};
+ state[that.entity_name+'-page'] = page;
+ IPA.nav.push_state(state);
};
that.table.refresh = function() {
- var page = parseInt(IPA.nav.get_state('page'), 10) || 1;
+ var state = {};
+ var page = parseInt(IPA.nav.get_state(that.entity_name+'-page'), 10) || 1;
if (page < 1) {
- IPA.nav.push_state({ page: 1 });
+ state[that.entity_name+'-page'] = 1;
+ IPA.nav.push_state(state);
return;
} else if (page > that.table.total_pages) {
- IPA.nav.push_state({ page: that.table.total_pages });
+ state[that.entity_name+'-page'] = that.table.total_pages;
+ IPA.nav.push_state(state);
return;
}
that.table.current_page = page;