MCPcopy Create free account
hub / github.com/TruthHun/BookStack / onChange

Function onChange

static/editor.md/lib/codemirror/addon/display/placeholder.js:47–53  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

45 if (isEmpty(cm)) setPlaceholder(cm);
46 }
47 function onChange(cm) {
48 var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);
49 wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "");
50
51 if (empty) setPlaceholder(cm);
52 else clearPlaceholder(cm);
53 }
54
55 function isEmpty(cm) {
56 return (cm.lineCount() === 1) && (cm.getLine(0) === "");

Callers 1

placeholder.jsFile · 0.70

Calls 3

setPlaceholderFunction · 0.85
clearPlaceholderFunction · 0.85
isEmptyFunction · 0.70

Tested by

no test coverage detected