mirror of
https://github.com/logseq/logseq.git
synced 2026-04-26 15:15:01 +00:00
enhance: show selection action bar on mouse up
This commit is contained in:
@@ -904,11 +904,11 @@
|
||||
(show! (cp-content/block-ref-custom-context-menu-content block block-ref))
|
||||
(state/set-state! :block-ref/context nil))
|
||||
|
||||
;; block selection
|
||||
;; block selection
|
||||
(and (state/selection?) (not (d/has-class? target "bullet")))
|
||||
(show! (cp-content/custom-context-menu-content))
|
||||
|
||||
;; block bullet
|
||||
;; block bullet
|
||||
(and block-id (parse-uuid block-id))
|
||||
(let [block (.closest target ".ls-block")
|
||||
property-default-value? (when block
|
||||
@@ -925,6 +925,15 @@
|
||||
[]
|
||||
nil)
|
||||
|
||||
(defonce *action-bar-timeout (atom nil))
|
||||
|
||||
(defn- on-mouse-up
|
||||
[_e]
|
||||
(when-let [timeout @*action-bar-timeout]
|
||||
(js/clearTimeout timeout))
|
||||
(let [timeout (js/setTimeout #(state/pub-event! [:editor/show-action-bar]) 200)]
|
||||
(reset! *action-bar-timeout timeout)))
|
||||
|
||||
(rum/defcs ^:large-vars/cleanup-todo root-container < rum/reactive
|
||||
(mixins/event-mixin
|
||||
(fn [state]
|
||||
@@ -1017,6 +1026,7 @@
|
||||
(ui/focus-element (ui/main-node))))}
|
||||
(t :accessibility/skip-to-main-content)]
|
||||
[:div.#app-container
|
||||
{:on-mouse-up on-mouse-up}
|
||||
[:div#left-container
|
||||
{:class (if (state/sub :ui/sidebar-open?) "overflow-hidden" "w-full")}
|
||||
(header/header {:light? light?
|
||||
|
||||
Reference in New Issue
Block a user