Only inject panel once
This commit is contained in:
parent
df1f091f47
commit
bc0825a558
|
@ -251,7 +251,15 @@
|
|||
:subvis [subvis/render-subvis traces]
|
||||
[render-traces])]]]))})))
|
||||
|
||||
(defn panel-div []
|
||||
(let [id "--re-frame-trace--"
|
||||
panel (.getElementById js/document id)]
|
||||
(if panel
|
||||
panel
|
||||
(let [new-panel (.createElement js/document "div")]
|
||||
(.setAttribute new-panel "id" id)
|
||||
(.appendChild (.-body js/document) new-panel)
|
||||
new-panel))))
|
||||
|
||||
(defn inject-devtools! []
|
||||
(let [div (.createElement js/document "div")]
|
||||
(.appendChild (.-body js/document) div)
|
||||
(r/render [devtools] div)))
|
||||
(r/render [devtools] (panel-div)))
|
||||
|
|
Loading…
Reference in New Issue