mirror of https://github.com/logseq/logseq
fix: zoom in/out lost editing state
parent
bff497415e
commit
9812fbe58e
|
@ -1147,7 +1147,7 @@
|
||||||
|
|
||||||
(declare save-current-block!)
|
(declare save-current-block!)
|
||||||
|
|
||||||
;; FIXME: doesn't work on Web (Chrome)
|
;; FIXME: shortcut `mod+.` doesn't work on Web (Chrome)
|
||||||
(defn zoom-in! []
|
(defn zoom-in! []
|
||||||
(if (state/editing?)
|
(if (state/editing?)
|
||||||
(when-let [id (some-> (state/get-edit-block)
|
(when-let [id (some-> (state/get-edit-block)
|
||||||
|
@ -1156,6 +1156,7 @@
|
||||||
db/entity
|
db/entity
|
||||||
:block/uuid)]
|
:block/uuid)]
|
||||||
(state/clear-editor-action!)
|
(state/clear-editor-action!)
|
||||||
|
(state/set-editing-block-id! [:unknown-container id])
|
||||||
(p/do!
|
(p/do!
|
||||||
(save-current-block!)
|
(save-current-block!)
|
||||||
(route-handler/redirect-to-page! id)))
|
(route-handler/redirect-to-page! id)))
|
||||||
|
@ -1170,6 +1171,7 @@
|
||||||
(state/clear-editor-action!)
|
(state/clear-editor-action!)
|
||||||
(save-current-block!)
|
(save-current-block!)
|
||||||
(when block-id
|
(when block-id
|
||||||
|
(state/set-editing-block-id! [:unknown-container block-id])
|
||||||
(let [block-parent (db/get-block-parent block-id)]
|
(let [block-parent (db/get-block-parent block-id)]
|
||||||
(if-let [id (and
|
(if-let [id (and
|
||||||
(nil? (:block/name block-parent))
|
(nil? (:block/name block-parent))
|
||||||
|
|
|
@ -667,7 +667,7 @@ Similar to re-frame subscriptions"
|
||||||
|
|
||||||
(defn set-editing-block-id!
|
(defn set-editing-block-id!
|
||||||
[container-block]
|
[container-block]
|
||||||
(swap! (:editor/editing? @state) assoc container-block true))
|
(reset! (:editor/editing? @state) {container-block true}))
|
||||||
|
|
||||||
(defn sub-editing?
|
(defn sub-editing?
|
||||||
[container-block]
|
[container-block]
|
||||||
|
|
Loading…
Reference in New Issue