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

Function onChange

external/.scrollLibs.js:13358–13365  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

13356 if (isEmpty(cm)) setPlaceholder(cm)
13357 }
13358 function onChange(cm) {
13359 var wrapper = cm.getWrapperElement(),
13360 empty = isEmpty(cm)
13361 wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "")
13362
13363 if (empty) setPlaceholder(cm)
13364 else clearPlaceholder(cm)
13365 }
13366
13367 function isEmpty(cm) {
13368 return cm.lineCount() === 1 && cm.getLine(0) === ""

Callers 1

.scrollLibs.jsFile · 0.85

Calls 4

isEmptyFunction · 0.85
setPlaceholderFunction · 0.85
clearPlaceholderFunction · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected