Skip to content

Commit f7c2856

Browse files
committed
Remove gap between sitcky/back states
1 parent a1c2fd8 commit f7c2856

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

plugins/editor/scroller.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ var Scroller = function() {
4040
//pre-bind functions and throttle expansion
4141
this.refresh = this._renderVisible.bind(this);
4242
this.scroll = this._onScroll.bind(this);
43-
this.expand = _.throttle(this._expand.bind(this), 100, {
43+
this.expand = _.throttle(this._expand.bind(this), 150, {
4444
leading: true,
45-
trailing: false
45+
trailing: true
4646
});
4747
};
4848

@@ -87,7 +87,7 @@ Scroller.prototype._renderVisible = function(){
8787
this.jumpToBottom = false;
8888
}else if(!this.sticky && this.startPosition > 0 && top === 0){
8989
//cover the situation where the window was fully scrolled faster than expand could keep up and locked to the top
90-
this.console.scrollTop = 1;
90+
requestAnimationFrame(this.expand);
9191
}
9292
this.dirty = false;
9393
}
@@ -115,11 +115,11 @@ Scroller.prototype._onScroll = function(){
115115
var scrollTop = this.console.scrollTop;
116116
if(!this.jumpToBottom && scrollTop < 15 && this.startPosition > 0){
117117
this.expand();
118-
}else if(!this.sticky && scrollTop + height > scrollHeight - 20){
118+
}else if(!this.sticky && scrollTop + height > scrollHeight - 30){
119119
this.jumpToBottom = true;
120120
this.sticky = true;
121121
this.dirty = true;
122-
}else if(this.sticky && scrollTop + height - 40 < scrollHeight){
122+
}else if(this.sticky && scrollTop + height < scrollHeight - 30){
123123
this.sticky = false;
124124
}
125125

0 commit comments

Comments
 (0)