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

Function paddingH

static/editor.md/lib/codemirror/lib/codemirror.js:2412–2419  ·  view source on GitHub ↗
(display)

Source from the content-addressed store, hash-verified

2410 function paddingTop(display) {return display.lineSpace.offsetTop;}
2411 function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;}
2412 function paddingH(display) {
2413 if (display.cachedPaddingH) return display.cachedPaddingH;
2414 var e = removeChildrenAndAdd(display.measure, elt("pre", "x"));
2415 var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;
2416 var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};
2417 if (!isNaN(data.left) && !isNaN(data.right)) display.cachedPaddingH = data;
2418 return data;
2419 }
2420
2421 function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth; }
2422 function displayWidth(cm) {

Callers 2

drawSelectionRangeFunction · 0.70
posFromMouseFunction · 0.70

Calls 2

removeChildrenAndAddFunction · 0.70
eltFunction · 0.70

Tested by

no test coverage detected