mirror of
https://github.com/logseq/logseq.git
synced 2026-04-30 00:46:23 +00:00
add middle click action and context menu
This commit is contained in:
committed by
Tienson Qin
parent
c6db111635
commit
bf17c700c8
@@ -1101,6 +1101,12 @@ Similar to re-frame subscriptions"
|
||||
(when (empty? (:sidebar/blocks @state))
|
||||
(hide-right-sidebar!)))
|
||||
|
||||
(defn sidebar-remove-rest!
|
||||
[db-id]
|
||||
(update-state! :sidebar/blocks (fn [blocks]
|
||||
(remove #(not= (second %) db-id) blocks)))
|
||||
(set-state! [:ui/sidebar-collapsed-blocks db-id] false))
|
||||
|
||||
(defn sidebar-replace-block!
|
||||
[old-sidebar-key new-sidebar-key]
|
||||
(update-state! :sidebar/blocks (fn [blocks]
|
||||
@@ -1121,6 +1127,11 @@ Similar to re-frame subscriptions"
|
||||
(when db-id
|
||||
(update-state! [:ui/sidebar-collapsed-blocks db-id] not)))
|
||||
|
||||
(defn sidebar-block-collapse-rest!
|
||||
[db-id]
|
||||
(let [items (disj (set (map second (:sidebar/blocks @state))) db-id)]
|
||||
(for [item items] (set-state! [:ui/sidebar-collapsed-blocks item] true))))
|
||||
|
||||
(defn get-edit-block
|
||||
[]
|
||||
(get @state :editor/block))
|
||||
|
||||
Reference in New Issue
Block a user