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

Function updateGutters

static/editor.md/lib/codemirror/lib/codemirror.js:306–319  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

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