feat(gesture): switch outdent and more icon

pull/5088/head
llcc 2022-05-27 12:14:18 +08:00
parent 1883d2ac06
commit c03ad5a781
2 changed files with 21 additions and 18 deletions

View File

@ -2094,8 +2094,8 @@
[:div.block-right-menu.flex.bg-base-2.rounded-md.ml-1
[:div.commands-button.w-0.flex.flew-col.rounded-md
{:id (str "block-right-menu-" uuid)}
[:div.outdent (ui/icon "indent-decrease" {:style {:fontSize 16}})]
[:div.more (ui/icon "dots-circle-horizontal" {:style {:fontSize 16}})]]])
[:div.more (ui/icon "dots-circle-horizontal" {:style {:fontSize 16}})]
[:div.outdent (ui/icon "indent-decrease" {:style {:fontSize 16}})]]])
(rum/defcs block-content-or-editor < rum/reactive
(rum/local true :hide-block-refs?)

View File

@ -215,15 +215,18 @@
(let [outdent (gdom/getFirstElementChild right)
more (gdom/getLastElementChild right)]
(when (outdentable? block)
(if (and (>= (.-clientWidth right) 40)
(< (.-clientWidth right) 80))
(set! (.. outdent -style -opacity) "100%")
(set! (.. outdent -style -opacity) "30%")))
(set! (.. outdent -style -opacity) "30%"))
(when (outdentable? block)
(if (>= (.-clientWidth right) 80)
(set! (.. more -style -opacity) "100%")
(set! (.. more -style -opacity) "30%")))))
(set! (.. more -style -opacity) "30%")
;; (set! (.. outdent -style -opacity) "100%")
;; (set! (.. outdent -style -opacity) "30%")
)))))
:else
nil))))))))
@ -244,18 +247,18 @@
:light))
(and right-menu (< 40 (.-clientWidth right-menu) 80))
(when (outdentable? block)
(haptics/with-haptics-impact
(indent-outdent-block! block :left)
:light))
(and right-menu (>= (.-clientWidth right-menu) 80))
(haptics/with-haptics-impact
(do (state/set-state! :mobile/show-action-bar? true)
(state/set-state! :mobile/actioned-block block)
(select-block! uuid))
:light)
(and right-menu (>= (.-clientWidth right-menu) 80))
(when (outdentable? block)
(haptics/with-haptics-impact
(indent-outdent-block! block :left)
:light))
:else
nil))
(catch js/Error e