0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 00:10:11 -05:00

Hide dragged item on sitemap sidebar widget.

This commit is contained in:
Andrey Antukh 2017-03-01 17:54:47 +01:00
parent 891dad0b11
commit 4aa3372e5b
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -42,14 +42,16 @@
(mx/defcs page-item
{:mixins [(mx/local) mx/static mx/reactive]}
[own page total active?]
(let [local (:rum/local own)
classes (classnames
:selected active?
:drag-active (:dragging @local)
:drag-top (= :top (:over @local))
:drag-bottom (= :bottom (:over @local))
:drag-inside (= :middle (:over @local)))]
[{:keys [rum/local] :as own} page total active?]
(let [body-classes (classnames
:selected active?
:drag-active (:dragging @local)
:drag-top (= :top (:over @local))
:drag-bottom (= :bottom (:over @local))
:drag-inside (= :middle (:over @local)))
li-classes (classnames
:selected active?
:hide (:dragging @local))]
(letfn [(on-edit [event]
(udl/open! :page-form {:page page}))
@ -96,9 +98,9 @@
(swap! local assoc :over true))
(on-drag-leave [event]
(swap! local assoc :over false))]
[:li {:class (when active? "selected")}
[:li {:class li-classes}
[:div.element-list-body
{:class classes
{:class body-classes
:style {:opacity (if (:dragging @local)
"0.5"
"1")}