recompute longestLine when vScroll changes

This commit is contained in:
nightwing 2013-07-14 08:22:15 +04:00
commit abf5f7492f

View file

@ -925,6 +925,16 @@ var VirtualRenderer = function(container, theme) {
offset = this.scrollTop - firstRowScreen * lineHeight;
var changes = 0;
// Horizontal scrollbar visibility may have changed, which changes
// the client height of the scroller
if (hScrollChanged || vScrollChanged) {
changes = this.$updateCachedSize(true, this.gutterWidth, this.$size.width, this.$size.height);
this._signal("scrollbarVisibilityChanged");
if (vScrollChanged)
longestLine = this.$getLongestLine();
}
this.layerConfig = {
width : longestLine,
padding : this.$padding,
@ -947,13 +957,6 @@ var VirtualRenderer = function(container, theme) {
this.content.style.width = longestLine + 2 * this.$padding + "px";
this.content.style.height = minHeight + "px";
var changes = 0;
// Horizontal scrollbar visibility may have changed, which changes
// the client height of the scroller
if (hScrollChanged || vScrollChanged) {
changes = this.$updateCachedSize(true, this.gutterWidth, this.$size.width, this.$size.height);
this._signal("scrollbarVisibilityChanged");
}
return changes;
};