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

Function updateLineBackground

static/mergely/lib/codemirror.js:918–928  ·  view source on GitHub ↗
(lineView)

Source from the content-addressed store, hash-verified

916 }
917
918 function updateLineBackground(lineView) {
919 var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass;
920 if (cls) cls += " CodeMirror-linebackground";
921 if (lineView.background) {
922 if (cls) lineView.background.className = cls;
923 else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }
924 } else if (cls) {
925 var wrap = ensureLineWrapped(lineView);
926 lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild);
927 }
928 }
929
930 // Wrapper around buildLineContent which will reuse the structure
931 // in display.externalMeasured when possible.

Callers 1

updateLineClassesFunction · 0.70

Calls 2

ensureLineWrappedFunction · 0.70
eltFunction · 0.70

Tested by

no test coverage detected