summaryrefslogtreecommitdiffstats
path: root/install/ui/navigation.js
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2011-04-11 14:49:36 -0400
committerAdam Young <ayoung@redhat.com>2011-04-26 16:49:23 -0400
commit1b12a282782173ce55e6bd7e1773a3b28686d81a (patch)
treec2ae570d16b375d92995fc77a187c77d951775da /install/ui/navigation.js
parent6f7984a532057fa173b6a645e5eaf525066edd1a (diff)
downloadfreeipa-1b12a282782173ce55e6bd7e1773a3b28686d81a.tar.gz
freeipa-1b12a282782173ce55e6bd7e1773a3b28686d81a.tar.xz
freeipa-1b12a282782173ce55e6bd7e1773a3b28686d81a.zip
action panel to top tabs
replacing the action panel with the Design for 2.1 Significantly cleaned up implementation of intra-entity navigation requires additional CSS work still need to integrate the search controls onto each page cleaning up interface between entity and facet simplified nested tabs logic Fixed role navigation select default tab from the search widget fixed unit tests and jsl keep tabs area allocated set default tab selected whenever the pkey changes. Removing styling that is changing positions of buttons. The logic for that was for action-panel, but does not translate to entity-header. change from metadata name to label for I18N set selected tab in entity_init. Default title for entities without search and pkeys associations in table now link. remove colon from title when not showing pkey added Managed by facet group. Removed entities that are, for some reason, invalid.
Diffstat (limited to 'install/ui/navigation.js')
-rw-r--r--install/ui/navigation.js60
1 files changed, 46 insertions, 14 deletions
diff --git a/install/ui/navigation.js b/install/ui/navigation.js
index 365bde66d..786a5a972 100644
--- a/install/ui/navigation.js
+++ b/install/ui/navigation.js
@@ -41,11 +41,12 @@ IPA.nav = {
},
create : function (nls, container, tabclass) {
- if (!container)
+ if (!container){
container = $('#navigation');
- if (!tabclass)
+ }
+ if (!tabclass){
tabclass = 'tabs';
-
+ }
IPA.nav.tabs_lists = nls;
IPA.nav.nav_container = container;
@@ -71,13 +72,22 @@ IPA.nav = {
var ul = $('<ul/>');
container.append(ul);
- for (var i = 0; i < nls.length; ++i) {
+ for (var i = 0; i < nls.length; i += 1) {
var tab = nls[i];
+ if (tab.entity){
+ tab.name = tab.entity;
+ }
var label = tab.name;
if (tab.entity) {
var entity = IPA.get_entity(tab.entity);
+ if (!entity){
+ nls.splice(i,1);
+ i -= 1;
+ continue;
+ }
label = entity.label;
+ tab.entity = entity;
}
if (tab.label){
label = tab.label;
@@ -93,7 +103,7 @@ IPA.nav = {
div.addClass('entity-container');
}
- if (tab.children && depth === 1) {
+ if (tab.children) {
IPA.nav.generate_tabs(tab.children, div, tabclass, depth +1 );
}
}
@@ -127,20 +137,42 @@ IPA.nav = {
var tab = nls[index];
var container2 = $('#' + tab.name);
- if (tab.children && depth === 1 ) {
+ if (tab.children) {
IPA.nav._update_tabs(tab.children, container2,depth+1);
-
} else if (tab.entity) {
- var entity_name = tab.entity;
+ tab.entity.setup(container2);
+ }
+ }
+};
- var nested_entity = IPA.nav.get_state(entity_name+'-entity');
- if (nested_entity){
- entity_name = nested_entity;
- }
- var entity = IPA.get_entity(entity_name);
- entity.setup(container2);
+IPA.tab_state = function(entity_name,tab){
+ var state;
+ var i;
+ var children;
+ var tab_name;
+
+ if (!tab){
+ children = IPA.tab_set;
+ tab_name = 'navigation';
+ }else if (tab.children){
+ children = tab.children;
+ tab_name = tab.name;
+ }else if (tab.entity){
+ if (tab.entity.name === entity_name){
+ state = {};
+ state[entity_name] = 0;
+ }
+ return state;
+ }
+
+ for (i = 0; i < children.length; i +=1){
+ state = IPA.tab_state(entity_name,children[i]);
+ if (state){
+ state[tab_name] = i;
+ return state;
}
}
+ return null;
};