enhance: highlight all blocks with the same id when pressing esc

This commit is contained in:
Tienson Qin
2022-04-05 11:12:31 +08:00
parent 3b8b7cf1a8
commit 5bac3be317

View File

@@ -1062,10 +1062,9 @@
(defn select-block!
[block-uuid]
(when-let [block (-> (str block-uuid)
(js/document.getElementsByClassName)
first)]
(state/exit-editing-and-set-selected-blocks! [block])))
(let [blocks (js/document.getElementsByClassName (str block-uuid))]
(when (seq blocks)
(state/exit-editing-and-set-selected-blocks! blocks))))
(defn- blocks-with-level
"Should be sorted already."