MCPcopy
hub / github.com/witheve/Eve / measureForScrollbars

Function measureForScrollbars

src/codemirror.js:385–399  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

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

Callers 4

updateScrollbarsFunction · 0.85
postUpdateDisplayFunction · 0.85
updateDisplaySimpleFunction · 0.85
endOperation_R2Function · 0.85

Calls 2

paddingVertFunction · 0.85
scrollGapFunction · 0.85

Tested by

no test coverage detected