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

Function updateGutters

static/mergely/lib/codemirror.js:312–325  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

310 // Rebuild the gutter elements, ensure the margin to the left of the
311 // code matches their width.
312 function updateGutters(cm) {
313 var gutters = cm.display.gutters, specs = cm.options.gutters;
314 removeChildren(gutters);
315 for (var i = 0; i < specs.length; ++i) {
316 var gutterClass = specs[i];
317 var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass));
318 if (gutterClass == "CodeMirror-linenumbers") {
319 cm.display.lineGutter = gElt;
320 gElt.style.width = (cm.display.lineNumWidth || 1) + "px";
321 }
322 }
323 gutters.style.display = i ? "" : "none";
324 updateGutterSpace(cm);
325 }
326
327 function updateGutterSpace(cm) {
328 var width = cm.display.gutters.offsetWidth;

Callers 2

CodeMirrorFunction · 0.70
guttersChangedFunction · 0.70

Calls 3

removeChildrenFunction · 0.70
eltFunction · 0.70
updateGutterSpaceFunction · 0.70

Tested by

no test coverage detected