MCPcopy Create free account
hub / github.com/TextGeneratorio/text-generator.io / updateLineBackground

Function updateLineBackground

static/libs/codemirror.js:2185–2196  ·  view source on GitHub ↗
(cm, lineView)

Source from the content-addressed store, hash-verified

2183}
2184
2185function updateLineBackground(cm, lineView) {
2186 var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass;
2187 if (cls) { cls += " CodeMirror-linebackground"; }
2188 if (lineView.background) {
2189 if (cls) { lineView.background.className = cls; }
2190 else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }
2191 } else if (cls) {
2192 var wrap = ensureLineWrapped(lineView);
2193 lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild);
2194 cm.display.input.setUneditable(lineView.background);
2195 }
2196}
2197
2198// Wrapper around buildLineContent which will reuse the structure
2199// in display.externalMeasured when possible.

Callers 1

updateLineClassesFunction · 0.85

Calls 2

ensureLineWrappedFunction · 0.85
eltFunction · 0.85

Tested by

no test coverage detected