MCPcopy
hub / github.com/DHTMLX/gantt / getDimensions

Function getDimensions

samples/common/codehighlight/codemirror.js:2901–2914  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

2899 // Do a bulk-read of the DOM positions and sizes needed to draw the
2900 // view, so that we don't interleave reading and writing to the DOM.
2901 function getDimensions(cm) {
2902 var d = cm.display, left = {}, width = {};
2903 var gutterLeft = d.gutters.clientLeft;
2904 for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
2905 var id = cm.display.gutterSpecs[i].className;
2906 left[id] = n.offsetLeft + n.clientLeft + gutterLeft;
2907 width[id] = n.clientWidth;
2908 }
2909 return {fixedPos: compensateForHScroll(d),
2910 gutterTotalWidth: d.gutters.offsetWidth,
2911 gutterLeft: left,
2912 gutterWidth: width,
2913 wrapperWidth: d.wrapper.clientWidth}
2914 }
2915
2916 // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,
2917 // but using getBoundingClientRect to get a sub-pixel-accurate

Callers 3

prepareMeasureForLineFunction · 0.85
DisplayUpdateFunction · 0.85
updateDisplayIfNeededFunction · 0.85

Calls 1

compensateForHScrollFunction · 0.85

Tested by

no test coverage detected