mirror of
https://github.com/logseq/logseq.git
synced 2026-04-26 15:15:01 +00:00
improve(ux): WIP support place fold arrow on the right of block container
This commit is contained in:
@@ -1707,7 +1707,7 @@
|
||||
(every? #(= % ["Horizontal_Rule"]) body)))
|
||||
|
||||
(rum/defcs block-control < rum/reactive
|
||||
[state config block uuid block-id collapsed? *control-show? edit?]
|
||||
[state config block uuid block-id collapsed? *control-show? edit? has-child?]
|
||||
(let [doc-mode? (state/sub :document/mode?)
|
||||
control-show? (util/react *control-show?)
|
||||
ref? (:ref? config)
|
||||
@@ -1717,20 +1717,22 @@
|
||||
:margin-top 0
|
||||
:float "left"}}
|
||||
|
||||
[:a.block-control
|
||||
{:id (str "control-" uuid)
|
||||
:on-click (fn [event]
|
||||
(util/stop event)
|
||||
(state/clear-edit!)
|
||||
(if ref?
|
||||
(state/toggle-collapsed-block! uuid)
|
||||
(if collapsed?
|
||||
(editor-handler/expand-block! uuid)
|
||||
(editor-handler/collapse-block! uuid))))}
|
||||
[:span {:class (if (and control-show?
|
||||
(or collapsed?
|
||||
(editor-handler/collapsable? uuid {:semantic? true}))) "control-show cursor-pointer" "control-hide")}
|
||||
(ui/rotating-arrow collapsed?)]]
|
||||
(when has-child?
|
||||
[:a.block-control
|
||||
{:id (str "control-" uuid)
|
||||
:on-click (fn [event]
|
||||
(util/stop event)
|
||||
(state/clear-edit!)
|
||||
(if ref?
|
||||
(state/toggle-collapsed-block! uuid)
|
||||
(if collapsed?
|
||||
(editor-handler/expand-block! uuid)
|
||||
(editor-handler/collapse-block! uuid))))}
|
||||
[:span {:class (if (and control-show?
|
||||
(or collapsed?
|
||||
(editor-handler/collapsable? uuid {:semantic? true}))) "control-show cursor-pointer" "control-hide")}
|
||||
(ui/rotating-arrow collapsed?)]])
|
||||
|
||||
(let [bullet [:a {:on-click (fn [event]
|
||||
(bullet-on-click event block uuid))}
|
||||
[:span.bullet-container.cursor
|
||||
@@ -2761,7 +2763,7 @@
|
||||
:on-mouse-leave (fn [e]
|
||||
(block-mouse-leave e *control-show? block-id doc-mode?))}
|
||||
(when (not slide?)
|
||||
(block-control config block uuid block-id collapsed? *control-show? edit?))
|
||||
(block-control config block uuid block-id collapsed? *control-show? edit? has-child?))
|
||||
|
||||
(when @*show-left-menu?
|
||||
(block-left-menu config block))
|
||||
|
||||
Reference in New Issue
Block a user