diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2014-07-22 14:15:30 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2014-07-28 10:21:37 +0200 |
commit | 9aed114d822efb0eaa01d93624bc0ea6612c4169 (patch) | |
tree | 15ac85ed0f16a64e4f5bd3d85631fff4156a29df | |
parent | fb975bba2076758f0615dae042aed2cde705a1b0 (diff) | |
download | freeipa-9aed114d822efb0eaa01d93624bc0ea6612c4169.tar.gz freeipa-9aed114d822efb0eaa01d93624bc0ea6612c4169.tar.xz freeipa-9aed114d822efb0eaa01d93624bc0ea6612c4169.zip |
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 <edewata@redhat.com>
-rw-r--r-- | install/ui/src/freeipa/facet.js | 5 | ||||
-rw-r--r-- | install/ui/src/freeipa/facets/Facet.js | 5 |
2 files changed, 10 insertions, 0 deletions
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'); }; diff --git a/install/ui/src/freeipa/facets/Facet.js b/install/ui/src/freeipa/facets/Facet.js index e015329c9..0608ab6fb 100644 --- a/install/ui/src/freeipa/facets/Facet.js +++ b/install/ui/src/freeipa/facets/Facet.js @@ -285,6 +285,8 @@ define(['dojo/_base/declare', if (!this.dom_node) { this.create(); this.render_children(); + } else if (!this.dom_node.parentElement) { + construct.place(this.dom_node, this.container_node); } dom_class.add(this.dom_node, 'active-facet'); @@ -295,6 +297,9 @@ define(['dojo/_base/declare', * Un-mark itself as active facet */ hide: function() { + if (this.dom_node.parentElement) { + this.container_node.removeChild(this.dom_node); + } dom_class.remove(this.dom_node, 'active-facet'); this.emit('hide', { source: this }); }, |