From 9aed114d822efb0eaa01d93624bc0ea6612c4169 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Tue, 22 Jul 2014 14:15:30 +0200 Subject: webui: detach facet nodes Detach/attach facet nodes when switching facets instead of hiding/showing. Keeps dom-tree more simple. Reviewed-By: Endi Sukma Dewata --- install/ui/src/freeipa/facet.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'install/ui/src/freeipa/facet.js') diff --git a/install/ui/src/freeipa/facet.js b/install/ui/src/freeipa/facet.js index 0bb697be0..50c12d49c 100644 --- a/install/ui/src/freeipa/facet.js +++ b/install/ui/src/freeipa/facet.js @@ -672,6 +672,8 @@ exp.facet = IPA.facet = function(spec, no_init) { if (!that.dom_node) { that.create(); + } else if (!that.dom_node.parentElement) { + construct.place(that.dom_node[0], that.container_node); } var state = that.state.clone(); @@ -728,6 +730,9 @@ exp.facet = IPA.facet = function(spec, no_init) { */ that.hide = function() { that.is_shown = false; + if (that.dom_node[0].parentElement) { + that.container_node.removeChild(that.dom_node[0]); + } that.dom_node.removeClass('active-facet'); }; -- cgit