mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 14:43:56 +00:00
fix(ui): right sidebar toggle functionality
This commit is contained in:
@@ -1115,11 +1115,6 @@ Similar to re-frame subscriptions"
|
||||
(when (empty? (:sidebar/blocks @state))
|
||||
(sidebar-add-block! (get-current-repo) "contents" :contents)))
|
||||
|
||||
(defn toggle-sidebar-open?!
|
||||
[]
|
||||
(when-not (:ui/sidebar-open? @state)
|
||||
(sidebar-add-content-when-open!))
|
||||
(swap! state update :ui/sidebar-open? not))
|
||||
|
||||
(defn open-right-sidebar!
|
||||
[]
|
||||
@@ -1130,6 +1125,12 @@ Similar to re-frame subscriptions"
|
||||
[]
|
||||
(swap! state assoc :ui/sidebar-open? false))
|
||||
|
||||
(defn toggle-sidebar-open?!
|
||||
[]
|
||||
(if (:ui/sidebar-open? @state)
|
||||
(hide-right-sidebar!)
|
||||
(open-right-sidebar!)))
|
||||
|
||||
(defn sidebar-move-block!
|
||||
[from to]
|
||||
(update-state! :sidebar/blocks (fn [blocks]
|
||||
|
||||
Reference in New Issue
Block a user