mirror of
https://github.com/status-im/re-frame-10x.git
synced 2025-02-09 20:53:29 +00:00
A few fixes in the subs screen for panel opening/closing
This commit is contained in:
parent
f0ce08c77d
commit
13b20bc511
@ -23,11 +23,11 @@
|
|||||||
|
|
||||||
;; TODO: START ========== LOCAL DATA - REPLACE WITH SUBS AND EVENTS
|
;; TODO: START ========== LOCAL DATA - REPLACE WITH SUBS AND EVENTS
|
||||||
|
|
||||||
(def *pods (r/atom [{:type :destroyed :layer "3" :path [:todo/blah] :open? true :diff? true}
|
(def *pods (r/atom [{:id (gensym) :type :destroyed :layer "3" :path [:todo/blah] :open? true :diff? true}
|
||||||
{:type :created :layer "3" :path [:todo/completed] :open? true :diff? true}
|
{:id (gensym) :type :created :layer "3" :path [:todo/completed] :open? true :diff? true}
|
||||||
{:type :re-run :layer "3" :path [:todo/completed] :open? true :diff? true}
|
{:id (gensym) :type :re-run :layer "3" :path [:todo/completed] :open? true :diff? true}
|
||||||
{:type :re-run :layer "2" :path [:todo/blah] :open? true :diff? true}
|
{:id (gensym) :type :re-run :layer "2" :path [:todo/blah] :open? true :diff? true}
|
||||||
{:type :not-run :layer "3" :path [:todo/blah] :open? true :diff? true}]
|
{:id (gensym) :type :not-run :layer "3" :path [:todo/blah] :open? true :diff? true}]
|
||||||
#_[]))
|
#_[]))
|
||||||
|
|
||||||
(defn update-pod-field
|
(defn update-pod-field
|
||||||
@ -35,7 +35,7 @@
|
|||||||
(let [f (fn [pod]
|
(let [f (fn [pod]
|
||||||
(if (= id (:id pod))
|
(if (= id (:id pod))
|
||||||
(do
|
(do
|
||||||
;(println "Updated" field "in" (:id pod) "from" (get pod field) "to" new-val)
|
(println "Updated" field "in" (:id pod) "from" (get pod field) "to" new-val)
|
||||||
(assoc pod field new-val))
|
(assoc pod field new-val))
|
||||||
pod))]
|
pod))]
|
||||||
(reset! *pods (mapv f @*pods))))
|
(reset! *pods (mapv f @*pods))))
|
||||||
@ -122,9 +122,7 @@
|
|||||||
:class "noselect"
|
:class "noselect"
|
||||||
:style {:cursor "pointer"}
|
:style {:cursor "pointer"}
|
||||||
:attr {:title (str (if open? "Close" "Open") " the pod bay doors, HAL")
|
:attr {:title (str (if open? "Close" "Open") " the pod bay doors, HAL")
|
||||||
:on-click (rc/handler-fn
|
:on-click (rc/handler-fn (update-pod-field id :open? (not open?)))}
|
||||||
(swap! open? not)
|
|
||||||
(println "Clicked [arrow]"))}
|
|
||||||
:child [rc/box
|
:child [rc/box
|
||||||
:margin "auto"
|
:margin "auto"
|
||||||
:child [:span.arrow (if open? "▼" "▶")]]]
|
:child [:span.arrow (if open? "▼" "▶")]]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user