fix #2183 scrollPastEnd breaks vScrollBarAlwaysVisible=false option
This commit is contained in:
parent
af859e2b0c
commit
fd5a6ade03
1 changed files with 12 additions and 11 deletions
|
|
@ -958,23 +958,24 @@ var VirtualRenderer = function(container, theme) {
|
|||
this.scrollBarH.setVisible(horizScroll);
|
||||
}
|
||||
|
||||
if (!this.$maxLines && this.$scrollPastEnd) {
|
||||
maxHeight += (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd;
|
||||
}
|
||||
|
||||
var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible ||
|
||||
size.scrollerHeight - maxHeight < 0);
|
||||
var vScrollChanged = this.$vScroll !== vScroll;
|
||||
if (vScrollChanged) {
|
||||
this.$vScroll = vScroll;
|
||||
this.scrollBarV.setVisible(vScroll);
|
||||
}
|
||||
var scrollPastEnd = !this.$maxLines && this.$scrollPastEnd
|
||||
? (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd
|
||||
: 0;
|
||||
maxHeight += scrollPastEnd;
|
||||
|
||||
this.session.setScrollTop(Math.max(-this.scrollMargin.top,
|
||||
Math.min(this.scrollTop, maxHeight - size.scrollerHeight + this.scrollMargin.bottom)));
|
||||
|
||||
this.session.setScrollLeft(Math.max(-this.scrollMargin.left, Math.min(this.scrollLeft,
|
||||
longestLine + 2 * this.$padding - size.scrollerWidth + this.scrollMargin.right)));
|
||||
|
||||
var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible ||
|
||||
size.scrollerHeight - maxHeight + scrollPastEnd < 0 || this.scrollTop);
|
||||
var vScrollChanged = this.$vScroll !== vScroll;
|
||||
if (vScrollChanged) {
|
||||
this.$vScroll = vScroll;
|
||||
this.scrollBarV.setVisible(vScroll);
|
||||
}
|
||||
|
||||
var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;
|
||||
var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue