Skip to content

Commit

Permalink
enhance: highlight all blocks with the same id when pressing esc
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin committed Apr 5, 2022
1 parent 3b8b7cf commit 5bac3be
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/frontend/handler/editor.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 5bac3be

Please sign in to comment.