Save showing state for panel to localstorage
This commit is contained in:
parent
0c336605f3
commit
f7cf12c1bb
|
@ -280,7 +280,7 @@
|
||||||
;; Filter out different trace types
|
;; Filter out different trace types
|
||||||
(let [position (r/atom :right)
|
(let [position (r/atom :right)
|
||||||
panel-width-ratio (r/atom (localstorage/get "panel-width-ratio" 0.35))
|
panel-width-ratio (r/atom (localstorage/get "panel-width-ratio" 0.35))
|
||||||
showing? (r/atom false)
|
showing? (r/atom (localstorage/get "show-panel" false))
|
||||||
dragging? (r/atom false)
|
dragging? (r/atom false)
|
||||||
pin-to-bottom? (r/atom true)
|
pin-to-bottom? (r/atom true)
|
||||||
selected-tab (r/atom :traces)
|
selected-tab (r/atom :traces)
|
||||||
|
@ -304,11 +304,14 @@
|
||||||
y (.-clientY e)]
|
y (.-clientY e)]
|
||||||
(.preventDefault e)
|
(.preventDefault e)
|
||||||
(reset! panel-width-ratio (/ (- window-width x) window-width)))))]
|
(reset! panel-width-ratio (/ (- window-width x) window-width)))))]
|
||||||
|
|
||||||
(add-watch panel-width-ratio
|
(add-watch panel-width-ratio
|
||||||
:update-panel-width-ratio
|
:update-panel-width-ratio
|
||||||
(fn [_ _ _ new-state]
|
(fn [_ _ _ new-state]
|
||||||
(localstorage/save! "panel-width-ratio" new-state)))
|
(localstorage/save! "panel-width-ratio" new-state)))
|
||||||
|
(add-watch showing?
|
||||||
|
:update-show-panel
|
||||||
|
(fn [_ _ _ new-state]
|
||||||
|
(localstorage/save! "show-panel" new-state)))
|
||||||
(r/create-class
|
(r/create-class
|
||||||
{:component-will-mount (fn []
|
{:component-will-mount (fn []
|
||||||
(js/window.addEventListener "keydown" handle-keys)
|
(js/window.addEventListener "keydown" handle-keys)
|
||||||
|
|
Loading…
Reference in New Issue