diff options
author | Endi S. Dewata <edewata@redhat.com> | 2011-04-28 19:17:58 -0500 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2011-05-05 14:57:45 -0500 |
commit | a4aba826a0e1327ba8df05da19d9ad0055d8269d (patch) | |
tree | 1c2ee009a6be1c09ef19f0c4e07c60799ce344f1 /install/ui/navigation.js | |
parent | dd89c28654c92c0922900409b37c1abcefc56c84 (diff) | |
download | freeipa-a4aba826a0e1327ba8df05da19d9ad0055d8269d.tar.gz freeipa-a4aba826a0e1327ba8df05da19d9ad0055d8269d.tar.xz freeipa-a4aba826a0e1327ba8df05da19d9ad0055d8269d.zip |
Added facet container.
Facet container has been added to hold facet header (i.e. title,
search fields, buttons, links) and facet content. Each facet now
occupies separate container, so it can be shown/hidden without
having to redraw the content.
Diffstat (limited to 'install/ui/navigation.js')
-rw-r--r-- | install/ui/navigation.js | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/install/ui/navigation.js b/install/ui/navigation.js index de42ef2ab..2fd3e513f 100644 --- a/install/ui/navigation.js +++ b/install/ui/navigation.js @@ -136,7 +136,7 @@ IPA.navigation = function(spec) { for (var i=0; i<tabs.length; i++) { var tab = tabs[i]; var tab_id = parent_id+'-'+i; - var label = tab.name; + if (tab.entity) { var entity = IPA.get_entity(tab.entity); if (!entity){ @@ -144,17 +144,17 @@ IPA.navigation = function(spec) { i--; continue; } - label = entity.label; tab.entity = entity; } - if (tab.label){ - label = tab.label; + + if (!tab.label) { + tab.label = entity.label; } $('<li/>').append($('<a/>', { href: '#'+tab_id, - title: label, - html: label + title: tab.label, + html: tab.label })).appendTo(ul); tab.container = $('<div/>', { @@ -164,19 +164,12 @@ IPA.navigation = function(spec) { if (tab.children && tab.children.length) { that._create(tab.children, tab.container, depth+1); - - } else if (tab.entity) { - tab.content = $('<div/>', { - name: tab.name, - title: label, - 'class': 'entity-container' - }).appendTo(that.content); } } }; that.update = function() { - $('.entity-container', that.content).css('display', 'none'); + $('.entity', that.content).css('display', 'none'); that._update(that.tabs, that.container, 1); }; @@ -197,7 +190,17 @@ IPA.navigation = function(spec) { that._update(tab.children, tab.container, depth+1); } else if (tab.entity) { - $('.entity-container[name="'+tab.entity.name+'"]', that.content).css('display', 'inline'); + var entity_container = $('.entity[name="'+tab.entity.name+'"]', that.content); + if (!entity_container.length) { + tab.content = $('<div/>', { + name: tab.name, + title: tab.label, + 'class': 'entity' + }).appendTo(that.content); + tab.entity.create(tab.content); + } + + entity_container.css('display', 'inline'); tab.entity.setup(tab.content); } }; |