Change View.show to call detach if the parentNode dosen't
[WebKit-https.git] / WebCore / page / inspector / View.js
index 9e22482..9daad12 100644 (file)
@@ -49,8 +49,10 @@ WebInspector.View.prototype = {
     show: function(parentElement)
     {
         this._visible = true;
-        if (!this.element.parentNode && parentElement)
+        if (parentElement && parentElement !== this.element.parentNode) {
+            this.detach();
             parentElement.appendChild(this.element);
+        }
         if (!this.element.parentNode && this.attach)
             this.attach();
         this.element.addStyleClass("visible");