Skip to content

Commit 86f176f

Browse files
committed
Tweak expand distance
1 parent 5c1803d commit 86f176f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/scroller.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ function Scroller(consoleElement) {
1313
this.jumpToBottom = true;
1414
this.dirty = false;
1515
this.console = consoleElement;
16+
this.expandDistance = 200;
1617

1718
//pre-bind functions and throttle expansion
1819
this.refresh = this._renderVisible.bind(this);
@@ -155,8 +156,8 @@ Scroller.prototype._onScroll = function(){
155156
const height = this.console.offsetHeight;
156157
const scrollHeight = this.console.scrollHeight;
157158
const scrollTop = this.console.scrollTop;
158-
const nearTop = scrollTop < 100;
159-
const nearBottom = scrollTop + height > scrollHeight - 100;
159+
const nearTop = scrollTop < this.expandDistance;
160+
const nearBottom = scrollTop + height > scrollHeight - this.expandDistance;
160161
const nearSticky = scrollTop + height > scrollHeight - 10;
161162

162163
if(this.sticky){

0 commit comments

Comments
 (0)