Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1957)

Unified Diff: Source/devtools/front_end/console/ConsoleView.js

Issue 462083002: DevTools: do not scroll console to bottom on resize (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: @vsevik comments Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/devtools/front_end/ui/ViewportControl.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/console/ConsoleView.js
diff --git a/Source/devtools/front_end/console/ConsoleView.js b/Source/devtools/front_end/console/ConsoleView.js
index e34354b2b225cfad48ea2fe14284096e959ed3cc..838b2c00e83bf56c1290a4492d57b4f1da4bf07d 100644
--- a/Source/devtools/front_end/console/ConsoleView.js
+++ b/Source/devtools/front_end/console/ConsoleView.js
@@ -89,7 +89,6 @@ WebInspector.ConsoleView = function(hideContextSelector)
this._messagesElement.id = "console-messages";
this._messagesElement.classList.add("monospace");
this._messagesElement.addEventListener("click", this._messagesClicked.bind(this), true);
- this._scrolledToBottom = true;
this._viewportThrottler = new WebInspector.Throttler(50);
@@ -415,15 +414,9 @@ WebInspector.ConsoleView.prototype = {
this._prompt.moveCaretToEndOfPrompt();
},
- storeScrollPositions: function()
- {
- WebInspector.View.prototype.storeScrollPositions.call(this);
- this._scrolledToBottom = this._messagesElement.isScrolledToBottom();
- },
-
restoreScrollPositions: function()
{
- if (this._scrolledToBottom)
+ if (this._viewport.scrolledToBottom())
this._immediatelyScrollIntoView();
else
WebInspector.View.prototype.restoreScrollPositions.call(this);
@@ -433,7 +426,8 @@ WebInspector.ConsoleView.prototype = {
{
this._scheduleViewportRefresh();
this._prompt.hideSuggestBox();
- this.restoreScrollPositions();
+ if (this._viewport.scrolledToBottom())
+ this._immediatelyScrollIntoView();
vsevik 2014/08/13 12:38:27 Would you mind renaming this to this._immediatelyS
},
_scheduleViewportRefresh: function()
@@ -568,7 +562,6 @@ WebInspector.ConsoleView.prototype = {
{
this._clearCurrentSearchResultHighlight();
this._consoleMessages = [];
- this._scrolledToBottom = true;
this._updateMessageList();
if (this._searchRegex)
« no previous file with comments | « no previous file | Source/devtools/front_end/ui/ViewportControl.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698