mirror of https://github.com/logseq/logseq
fix: toggle help
parent
759667e041
commit
21b2c5296a
|
@ -292,7 +292,7 @@
|
||||||
;; ?
|
;; ?
|
||||||
191 (fn [state e]
|
191 (fn [state e]
|
||||||
(when-not (util/input? (gobj/get e "target"))
|
(when-not (util/input? (gobj/get e "target"))
|
||||||
(state/sidebar-add-block! (state/get-current-repo) "help" :help nil)))})))
|
(ui-handler/toggle-help!)))})))
|
||||||
{:did-mount (fn [state]
|
{:did-mount (fn [state]
|
||||||
(keyboards/bind-shortcuts!)
|
(keyboards/bind-shortcuts!)
|
||||||
state)}
|
state)}
|
||||||
|
|
|
@ -33,6 +33,14 @@
|
||||||
(state/sidebar-remove-block! id)
|
(state/sidebar-remove-block! id)
|
||||||
(state/sidebar-add-block! current-repo id :contents nil)))))
|
(state/sidebar-add-block! current-repo id :contents nil)))))
|
||||||
|
|
||||||
|
(defn toggle-help!
|
||||||
|
[]
|
||||||
|
(when-let [current-repo (state/get-current-repo)]
|
||||||
|
(let [id "help"]
|
||||||
|
(if (state/sidebar-block-exists? id)
|
||||||
|
(state/sidebar-remove-block! id)
|
||||||
|
(state/sidebar-add-block! current-repo id :help nil)))))
|
||||||
|
|
||||||
(defn toggle-settings-modal!
|
(defn toggle-settings-modal!
|
||||||
[]
|
[]
|
||||||
(state/toggle-settings!))
|
(state/toggle-settings!))
|
||||||
|
|
|
@ -652,8 +652,8 @@
|
||||||
(defn sidebar-remove-block!
|
(defn sidebar-remove-block!
|
||||||
[idx]
|
[idx]
|
||||||
(update-state! :sidebar/blocks (fn [blocks]
|
(update-state! :sidebar/blocks (fn [blocks]
|
||||||
(if (= (str idx) "contents")
|
(if (string? idx)
|
||||||
(remove #(= (second %) "contents") blocks)
|
(remove #(= (second %) idx) blocks)
|
||||||
(util/drop-nth idx blocks))))
|
(util/drop-nth idx blocks))))
|
||||||
(when (empty? (:sidebar/blocks @state))
|
(when (empty? (:sidebar/blocks @state))
|
||||||
(hide-right-sidebar!)))
|
(hide-right-sidebar!)))
|
||||||
|
|
Loading…
Reference in New Issue