From 7b91e9d83dd12c18ebe5d57f3fb86e1c27703b58 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Fri, 19 Nov 2010 15:57:40 -0500 Subject: top nav index allows links between differnt top level tabs by calculating the index of the top level tab for the target tab. new version creats third level navigation for nested entities, such as SUDO and HBAC --- install/static/widget.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'install/static/widget.js') diff --git a/install/static/widget.js b/install/static/widget.js index 060f258e..c2184c64 100755 --- a/install/static/widget.js +++ b/install/static/widget.js @@ -421,6 +421,7 @@ function ipa_button_widget(spec) { return that; } + function ipa_column_widget(spec) { spec = spec || {}; @@ -431,6 +432,7 @@ function ipa_column_widget(spec) { that.primary_key = spec.primary_key; that.setup = spec.setup || setup; that.link = spec.link; + that.other_entity = spec.other_entity; function setup(container, name, value, record) { @@ -445,13 +447,11 @@ function ipa_column_widget(spec) { 'html': value, 'click': function (value) { return function() { - var state = {}; - state[that.entity_name + '-facet'] = 'details'; - state[that.entity_name + '-pkey'] = value; - //Before this will work, we need to set the tab one level up - //for example: - //state['identity'] = 0; - //but we have no way of getting the index. + var target_entity = that.other_entity || + that.entity_name; + var state = IPA.tab_state(target_entity); + state[target_entity + '-facet'] = 'details'; + state[target_entity + '-pkey'] = value; $.bbq.pushState(state); return false; -- cgit