code: function(index, height) {
        var currentPos = (this.dimensions[index] || {}).primaryPos || 0;
        this.currentIndex = index;
  
        this.hasPrevIndex = index > 0;
        if (this.hasPrevIndex) {
          this.previousPos = Math.max(
            currentPos - this.dimensions[index - 1].primarySize,
            this.dimensions[index - 1].primaryPos
          );
        }
        this.hasNextIndex = index + 1 < this.dataSource.getLength();
        if (this.hasNextIndex) {
          this.nextPos = Math.min(
            currentPos + this.dimensions[index + 1].primarySize,
            this.dimensions[index + 1].primaryPos
          );
        }
      }
docs: /*
  setCurrentIndex sets the index in the list that matches the scroller's position.
  Also save the position in the scroller for next and previous items (if they exist)