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

Function updateLineBackground

external/.scrollLibs.js:3332–3349  ·  view source on GitHub ↗
(cm, lineView)

Source from the content-addressed store, hash-verified

3330 }
3331
3332 function updateLineBackground(cm, lineView) {
3333 var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass
3334 if (cls) {
3335 cls += " CodeMirror-linebackground"
3336 }
3337 if (lineView.background) {
3338 if (cls) {
3339 lineView.background.className = cls
3340 } else {
3341 lineView.background.parentNode.removeChild(lineView.background)
3342 lineView.background = null
3343 }
3344 } else if (cls) {
3345 var wrap = ensureLineWrapped(lineView)
3346 lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild)
3347 cm.display.input.setUneditable(lineView.background)
3348 }
3349 }
3350
3351 // Wrapper around buildLineContent which will reuse the structure
3352 // in display.externalMeasured when possible.

Callers 1

updateLineClassesFunction · 0.85

Calls 2

ensureLineWrappedFunction · 0.85
eltFunction · 0.85

Tested by

no test coverage detected