function scrollTo(y, x) {
      if (x == null) {
        x = prevScrollLeft;
      }
      if (y == null) {
        y = prevScrollTop;
      }

      x = Math.max(x, 0);
      y = Math.max(y, 0);
      y = Math.min(y, virtualTotalHeight - viewportH + (viewportHasHScroll ? scrollbarDimensions.height : 0));

      var oldOffset = pageOffset;

      page = Math.min(numberOfPages - 1, pageHeight > 0 ? Math.floor(y / pageHeight) : 0);
      pageOffset = Math.round(page * jumpinessCoefficient);
      var newScrollTop = y - pageOffset;

      // if (pageOffset !== oldOffset) {
      //   var range = getVisibleRange(newScrollTop);
      //   cleanUpRows(range);
      // }

      var viewportChanged = false;

      if (prevScrollTop !== newScrollTop) {
        //console.log("scrollTo caused a change!: ", prevScrollTop, newScrollTop, pageOffset, oldOffset, page, y, range);
        vScrollDir = (prevScrollTop + oldOffset < newScrollTop + pageOffset) ? 1 : -1;
        $viewport[0].scrollTop = prevScrollTop = scrollTop = newScrollTop;
        viewportChanged = true;
      }

      var newScrollLeft = x;
      if (prevScrollLeft !== newScrollLeft) {
        $viewport[0].scrollLeft = prevScrollLeft = scrollLeft = newScrollLeft;
        viewportChanged = true;
      }

      if (viewportChanged) {
        trigger(self.onViewportChanged, {});
        return true;
      }
      return false;
    }
// return FALSE when there's been no movement.
return FALSE when there's been no movement.
return FALSE when there ' s been no movement .
function scrollTo(y, x) {
      if (x == null) {
        x = prevScrollLeft;
      }
      if (y == null) {
        y = prevScrollTop;
      }
      x = Math.max(x, 0);
      y = Math.max(y, 0);
      y = Math.min(y, virtualTotalHeight - viewportH + (viewportHasHScroll ? scrollbarDimensions.height : 0));
      var oldOffset = pageOffset;
      page = Math.min(numberOfPages - 1, pageHeight > 0 ? Math.floor(y / pageHeight) : 0);
      pageOffset = Math.round(page * jumpinessCoefficient);
      var newScrollTop = y - pageOffset;
      var viewportChanged = false;
      if (prevScrollTop !== newScrollTop) {
        vScrollDir = (prevScrollTop + oldOffset < newScrollTop + pageOffset) ? 1 : -1;
        $viewport[0].scrollTop = prevScrollTop = scrollTop = newScrollTop;
        viewportChanged = true;
      }
      var newScrollLeft = x;
      if (prevScrollLeft !== newScrollLeft) {
        $viewport[0].scrollLeft = prevScrollLeft = scrollLeft = newScrollLeft;
        viewportChanged = true;
      }
      if (viewportChanged) {
        trigger(self.onViewportChanged, {});
        return true;
      }
      return false;
    }
function scrollTo ( y , x ) { if ( x == null ) { x = prevScrollLeft ; } if ( y == null ) { y = prevScrollTop ; } x = Math . max ( x , 0 ) ; y = Math . max ( y , 0 ) ; y = Math . min ( y , virtualTotalHeight - viewportH + ( viewportHasHScroll ? scrollbarDimensions . height : 0 ) ) ; var oldOffset = pageOffset ; page = Math . min ( numberOfPages - 1 , pageHeight > 0 ? Math . floor ( y / pageHeight ) : 0 ) ; pageOffset = Math . round ( page * jumpinessCoefficient ) ; var newScrollTop = y - pageOffset ; var viewportChanged = false ; if ( prevScrollTop !== newScrollTop ) { vScrollDir = ( prevScrollTop + oldOffset < newScrollTop + pageOffset ) ? 1 : - 1 ; $viewport [ 0 ] . scrollTop = prevScrollTop = scrollTop = newScrollTop ; viewportChanged = true ; } var newScrollLeft = x ; if ( prevScrollLeft !== newScrollLeft ) { $viewport [ 0 ] . scrollLeft = prevScrollLeft = scrollLeft = newScrollLeft ; viewportChanged = true ; } if ( viewportChanged ) { trigger ( self . onViewportChanged , { } ) ; return true ; } return false ; }
return FALSE when there's been no movement.
return FALSE when there ' s been no movement .
// if (pageOffset !== oldOffset) { //   var range = getVisibleRange(newScrollTop); //   cleanUpRows(range); // } //console.log("scrollTo caused a change!: ", prevScrollTop, newScrollTop, pageOffset, oldOffset, page, y, range);