MCPcopy Create free account
hub / github.com/breck7/scroll / forEachCodeMirror

Function forEachCodeMirror

external/.scrollLibs.js:8916–8935  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

8914 // garbage collected.
8915
8916 function forEachCodeMirror(f) {
8917 if (!document.getElementsByClassName) {
8918 return
8919 }
8920 var byClass = document.getElementsByClassName("CodeMirror"),
8921 editors = []
8922 for (var i = 0; i < byClass.length; i++) {
8923 var cm = byClass[i].CodeMirror
8924 if (cm) {
8925 editors.push(cm)
8926 }
8927 }
8928 if (editors.length) {
8929 editors[0].operation(function () {
8930 for (var i = 0; i < editors.length; i++) {
8931 f(editors[i])
8932 }
8933 })
8934 }
8935 }
8936
8937 var globalsRegistered = false
8938 function ensureGlobalHandlers() {

Callers 1

registerGlobalHandlersFunction · 0.85

Calls 1

fFunction · 0.70

Tested by

no test coverage detected