| Index: Source/devtools/front_end/ui/ViewportControl.js
|
| diff --git a/Source/devtools/front_end/ui/ViewportControl.js b/Source/devtools/front_end/ui/ViewportControl.js
|
| index 938e056583870d839a3e161e47307942acbf19f7..789ee1a04c7d5a24f1cfb084d3342cfc0479d680 100644
|
| --- a/Source/devtools/front_end/ui/ViewportControl.js
|
| +++ b/Source/devtools/front_end/ui/ViewportControl.js
|
| @@ -55,6 +55,7 @@ WebInspector.ViewportControl = function(provider)
|
| this._anchorSelection = null;
|
| this._headSelection = null;
|
| this._stickToBottom = false;
|
| + this._scrolledToBottom = true;
|
| }
|
|
|
| /**
|
| @@ -133,6 +134,14 @@ WebInspector.StaticViewportElement.prototype = {
|
|
|
| WebInspector.ViewportControl.prototype = {
|
| /**
|
| + * @return {boolean}
|
| + */
|
| + scrolledToBottom: function()
|
| + {
|
| + return this._scrolledToBottom;
|
| + },
|
| +
|
| + /**
|
| * @param {boolean} value
|
| */
|
| setStickToBottom: function(value)
|
| @@ -373,7 +382,7 @@ WebInspector.ViewportControl.prototype = {
|
|
|
| var visibleFrom = this.element.scrollTop;
|
| var visibleHeight = this._visibleHeight();
|
| - var shouldStickToBottom = this._stickToBottom && this.element.isScrolledToBottom();
|
| + this._scrolledToBottom = this.element.isScrolledToBottom();
|
| var isInvalidating = !this._cumulativeHeights;
|
|
|
| if (this._cumulativeHeights && itemCount !== this._cumulativeHeights.length)
|
| @@ -387,6 +396,8 @@ WebInspector.ViewportControl.prototype = {
|
| this._rebuildCumulativeHeightsIfNeeded();
|
| var oldFirstVisibleIndex = this._firstVisibleIndex;
|
| var oldLastVisibleIndex = this._lastVisibleIndex;
|
| +
|
| + var shouldStickToBottom = this._stickToBottom && this._scrolledToBottom;
|
| if (shouldStickToBottom) {
|
| this._lastVisibleIndex = itemCount - 1;
|
| this._firstVisibleIndex = Math.max(itemCount - Math.ceil(visibleHeight / this._provider.minimumRowHeight()), 0);
|
|
|