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

Function setScrollLeft

samples/common/codehighlight/codemirror.js:3570–3577  ·  view source on GitHub ↗
(cm, val, isScroller, forceScroll)

Source from the content-addressed store, hash-verified

3568 // Sync scroller and scrollbar, ensure the gutter elements are
3569 // aligned.
3570 function setScrollLeft(cm, val, isScroller, forceScroll) {
3571 val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));
3572 if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }
3573 cm.doc.scrollLeft = val;
3574 alignHorizontally(cm);
3575 if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }
3576 cm.display.scrollbars.setScrollLeft(val);
3577 }
3578
3579 // SCROLLBARS
3580

Callers 7

scrollPosIntoViewFunction · 0.85
scrollIntoViewFunction · 0.85
initScrollbarsFunction · 0.85
endOperation_W2Function · 0.85
endOperation_finishFunction · 0.85
onScrollWheelFunction · 0.85
registerEventHandlersFunction · 0.85

Calls 1

alignHorizontallyFunction · 0.85

Tested by

no test coverage detected