We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2754478 commit 5c51f54Copy full SHA for 5c51f54
src/edit/global_events.js
@@ -7,11 +7,14 @@ import { on } from "../util/event.js"
7
8
function forEachCodeMirror(f) {
9
if (!document.getElementsByClassName) return
10
- let byClass = document.getElementsByClassName("CodeMirror")
+ let byClass = document.getElementsByClassName("CodeMirror"), editors = []
11
for (let i = 0; i < byClass.length; i++) {
12
let cm = byClass[i].CodeMirror
13
- if (cm) f(cm)
+ if (cm) editors.push(cm)
14
}
15
+ if (editors.length) editors[0].operation(() => {
16
+ for (let i = 0; i < editors.length; i++) f(editors[i])
17
+ })
18
19
20
let globalsRegistered = false
0 commit comments