From a4aba826a0e1327ba8df05da19d9ad0055d8269d Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Thu, 28 Apr 2011 19:17:58 -0500 Subject: 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. --- install/ui/navigation.js | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'install/ui/navigation.js') diff --git a/install/ui/navigation.js b/install/ui/navigation.js index de42ef2a..2fd3e513 100644 --- a/install/ui/navigation.js +++ b/install/ui/navigation.js @@ -136,7 +136,7 @@ IPA.navigation = function(spec) { for (var i=0; i').append($('', { href: '#'+tab_id, - title: label, - html: label + title: tab.label, + html: tab.label })).appendTo(ul); tab.container = $('
', { @@ -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 = $('
', { - 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 = $('
', { + 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); } }; -- cgit