resize scrollbar for scrollPastEnd only when needed
This commit is contained in:
parent
b97496009b
commit
8a6320bfd1
1 changed files with 10 additions and 4 deletions
|
|
@ -864,9 +864,14 @@ var VirtualRenderer = function(container, theme) {
|
|||
this.scrollBarH.setVisible(horizScroll);
|
||||
}
|
||||
|
||||
if (!this.$maxLines && this.$scrollPastEnd)
|
||||
maxHeight += (this.$size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd;
|
||||
|
||||
if (!this.$maxLines && this.$scrollPastEnd) {
|
||||
if (this.scrollTop > maxHeight - this.$size.scrollerHeight)
|
||||
maxHeight += Math.min(
|
||||
(this.$size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd,
|
||||
this.scrollTop - maxHeight + this.$size.scrollerHeight
|
||||
);
|
||||
}
|
||||
|
||||
var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible ||
|
||||
this.$size.scrollerHeight - maxHeight < 0);
|
||||
var vScrollChanged = this.$vScroll !== vScroll;
|
||||
|
|
@ -1271,7 +1276,8 @@ var VirtualRenderer = function(container, theme) {
|
|||
if (deltaY < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top)
|
||||
return true;
|
||||
if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight
|
||||
- this.layerConfig.maxHeight < -1 + this.scrollMargin.bottom)
|
||||
- this.layerConfig.maxHeight - (this.$size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd
|
||||
< -1 + this.scrollMargin.bottom)
|
||||
return true;
|
||||
// todo: better handle horizontal scrolling
|
||||
if (deltaX)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue