summaryrefslogtreecommitdiffstats
path: root/install/ui/navigation.js
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2011-06-29 09:26:49 -0400
committerAdam Young <ayoung@redhat.com>2011-06-29 17:09:57 -0400
commitb8b2ac53573620711ce1acfce34a919ffa23e143 (patch)
treec55df575254b663889e7f15332e6798bfeff9a17 /install/ui/navigation.js
parent66eeaceb8cc50902b408e5c97c6d04e59e57f97a (diff)
downloadfreeipa.git-b8b2ac53573620711ce1acfce34a919ffa23e143.tar.gz
freeipa.git-b8b2ac53573620711ce1acfce34a919ffa23e143.tar.xz
freeipa.git-b8b2ac53573620711ce1acfce34a919ffa23e143.zip
containing entity pkeys
Instead of looking for a match on the entity name, use the nesting structure of containing entites to grab their pkeys. Code review fixes https://fedorahosted.org/freeipa/ticket/674
Diffstat (limited to 'install/ui/navigation.js')
-rw-r--r--install/ui/navigation.js28
1 files changed, 23 insertions, 5 deletions
diff --git a/install/ui/navigation.js b/install/ui/navigation.js
index d0b45cc3..9bcb20f0 100644
--- a/install/ui/navigation.js
+++ b/install/ui/navigation.js
@@ -115,14 +115,32 @@ IPA.navigation = function(spec) {
while(state[key]){
var value = state[key];
url_state[key] = value;
- var entity = value;
- for (var key2 in state){
- if ((key2 === entity) || (key2.search('^'+entity) > -1)){
- url_state[key2] = state[key2];
+ key = value;
+ }
+
+ /*We are at the leaf node, which is the sleected entity.*/
+ var entity = value;
+ for (var key2 in state){
+ if ((key2 === entity) || (key2.search('^'+entity +'-') > -1)){
+ url_state[key2] = state[key2];
+ }
+ }
+
+ /*
+ Trace back up the nested entities for their pkeys as well
+ */
+ var current_entity = IPA.get_entity(entity);
+ while(current_entity !== null){
+ var key_names = current_entity.get_key_names();
+ for (var j = 0; j < key_names.length; j+= 1){
+ var key_name = key_names[j];
+ if (state[key_name]){
+ url_state[key_name] = state[key_name];
}
}
- key = value;
+ current_entity = current_entity.containing_entity;
}
+
$.bbq.pushState(url_state,2);
return true;
};