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

Function measureForScrollbars

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

Source from the content-addressed store, hash-verified

382 // Prepare DOM reads needed to update the scrollbars. Done in one
383 // shot to minimize update/measure roundtrips.
384 function measureForScrollbars(cm) {
385 var d = cm.display, gutterW = d.gutters.offsetWidth;
386 var docH = Math.round(cm.doc.height + paddingVert(cm.display));
387 return {
388 clientHeight: d.scroller.clientHeight,
389 viewHeight: d.wrapper.clientHeight,
390 scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,
391 viewWidth: d.wrapper.clientWidth,
392 barLeft: cm.options.fixedGutter ? gutterW : 0,
393 docHeight: docH,
394 scrollHeight: docH + scrollGap(cm) + d.barHeight,
395 nativeBarWidth: d.nativeBarWidth,
396 gutterWidth: gutterW
397 };
398 }
399
400 function NativeScrollbars(place, scroll, cm) {
401 this.cm = cm;

Callers 4

updateScrollbarsFunction · 0.70
postUpdateDisplayFunction · 0.70
updateDisplaySimpleFunction · 0.70
endOperation_R2Function · 0.70

Calls 2

paddingVertFunction · 0.70
scrollGapFunction · 0.70

Tested by

no test coverage detected