diff --git a/install/ui/add.js b/install/ui/add.js
index 45b49899f..7a7bd086b 100644
--- a/install/ui/add.js
+++ b/install/ui/add.js
@@ -77,10 +77,7 @@ IPA.add_dialog = function (spec) {
var pkey_name = IPA.metadata.objects[that.entity_name].primary_key;
var pkey = record[pkey_name];
- var state = {};
- state[that.entity_name + '-facet'] = 'details';
- state[that.entity_name + '-pkey'] = pkey;
- $.bbq.pushState(state);
+ IPA.nav.show_page(that.entity_name, 'details', pkey);
}
);
});
diff --git a/install/ui/associate.js b/install/ui/associate.js
index 77738bbab..632fcc52d 100644
--- a/install/ui/associate.js
+++ b/install/ui/associate.js
@@ -288,10 +288,7 @@ IPA.association_pkey_setup = function (container, record) {
'html': value,
'click': function (value) {
return function() {
- var state = IPA.tab_state(other_entity);
- state[other_entity + '-facet'] = 'default';
- state[other_entity + '-pkey'] = value;
- $.bbq.pushState(state);
+ IPA.nav.show_page(other_entity, 'default', value);
return false;
};
}(value)
@@ -776,10 +773,7 @@ IPA.association_facet = function (spec) {
'html': value,
'click': function (value) {
return function() {
- var state = IPA.tab_state(that.other_entity);
- state[that.other_entity + '-facet'] = 'default';
- state[that.other_entity + '-pkey'] = value;
- $.bbq.pushState(state);
+ IPA.nav.show_page(that.other_entity, 'default', value);
return false;
};
}(value)
diff --git a/install/ui/entity.js b/install/ui/entity.js
index e6e63cd32..a4488756e 100644
--- a/install/ui/entity.js
+++ b/install/ui/entity.js
@@ -455,7 +455,7 @@ IPA.entity_header = function(spec){
return false;
}
- IPA.show_page(entity.name, 'search');
+ IPA.nav.show_page(entity.name, 'search');
$(that.facet_tabs).find('a').removeClass('selected');
return false;
@@ -483,7 +483,7 @@ IPA.entity_header = function(spec){
return false;
}
var this_pkey = that.pkey_field.val();
- IPA.show_page(
+ IPA.nav.show_page(
entity_name, other_facet_name,
this_pkey);
$(that.facet_tabs).find('a').removeClass('selected');
diff --git a/install/ui/hbac.js b/install/ui/hbac.js
index f0a9e214f..a7e36282c 100644
--- a/install/ui/hbac.js
+++ b/install/ui/hbac.js
@@ -121,10 +121,7 @@ IPA.hbacsvcgroup_member_hbacsvc_table_widget = function (spec) {
'html': value,
'click': function (value) {
return function() {
- var state = IPA.tab_state(that.other_entity);
- state[that.other_entity + '-facet'] = 'details';
- state[that.other_entity + '-pkey'] = value;
- $.bbq.pushState(state);
+ IPA.nav.show_page(that.other_entity, 'details', value);
return false;
};
}(value)
diff --git a/install/ui/host.js b/install/ui/host.js
index bd694ee61..cf78970f8 100644
--- a/install/ui/host.js
+++ b/install/ui/host.js
@@ -379,10 +379,7 @@ IPA.host_managedby_host_facet = function (spec) {
'html': value,
'click': function (value) {
return function() {
- var state = IPA.tab_state(that.other_entity);
- state[that.other_entity + '-facet'] = 'details';
- state[that.other_entity + '-pkey'] = value;
- $.bbq.pushState(state);
+ IPA.nav.show_page(that.other_entity, 'details', value);
return false;
};
}(value)
diff --git a/install/ui/ipa.js b/install/ui/ipa.js
index db60326e4..83b25e509 100644
--- a/install/ui/ipa.js
+++ b/install/ui/ipa.js
@@ -185,21 +185,6 @@ var IPA = ( function () {
return true;
};
- that.show_page = function(entity_name, facet_name, pkey) {
- if (!IPA.test_dirty()) {
- return;
- }
-
- var state = {};
-
- if (pkey) {
- state[entity_name + '-pkey'] = pkey;
- }
-
- state[entity_name + '-facet'] = facet_name;
- $.bbq.pushState(state);
- };
-
that.display_activity_icon = function() {
that.network_call_count++;
$('.network-activity-indicator').css('display','inline');
diff --git a/install/ui/navigation.js b/install/ui/navigation.js
index 3043b7c43..9b8f649df 100644
--- a/install/ui/navigation.js
+++ b/install/ui/navigation.js
@@ -30,7 +30,53 @@ IPA.navigation = function(spec) {
that.container = spec.container;
that.tab_class = spec.tab_class || 'tabs';
- that.tabs = spec.tabs || [];
+ that.tabs = [];
+ that.tabs_by_name = {};
+
+ that.set_tabs = function(tabs) {
+ that.tabs = tabs;
+ that.tabs_by_name = {};
+
+ for (var i=0; i