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

Function updateScrollTop

samples/common/codehighlight/codemirror.js:3552–3558  ·  view source on GitHub ↗
(cm, val)

Source from the content-addressed store, hash-verified

3550 // Sync the scrollable area and scrollbars, ensure the viewport
3551 // covers the visible area.
3552 function updateScrollTop(cm, val) {
3553 if (Math.abs(cm.doc.scrollTop - val) < 2) { return }
3554 if (!gecko) { updateDisplaySimple(cm, {top: val}); }
3555 setScrollTop(cm, val, true);
3556 if (gecko) { updateDisplaySimple(cm); }
3557 startWorker(cm, 100);
3558 }
3559
3560 function setScrollTop(cm, val, forceScroll) {
3561 val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));

Callers 5

scrollPosIntoViewFunction · 0.85
scrollIntoViewFunction · 0.85
initScrollbarsFunction · 0.85
onScrollWheelFunction · 0.85
registerEventHandlersFunction · 0.85

Calls 3

updateDisplaySimpleFunction · 0.85
setScrollTopFunction · 0.85
startWorkerFunction · 0.85

Tested by

no test coverage detected