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

Unified Diff: third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js

Issue 2565113002: DevTools: update console viewport scroll when prompt is resized (Closed)
Patch Set: SourcesTE listen to same event Created 3 years, 9 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
Index: third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js b/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js
index caa0df9bbe7f001aafa7d10e9d5a1c4852d96727..70bfdc4821b7703e32f3efa8a6f9380e17d96cbe 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js
@@ -32,6 +32,7 @@ Console.ConsolePrompt = class extends UI.Widget {
});
this._editor.widget().element.addEventListener('keydown', this._editorKeyDown.bind(this), true);
this._editor.widget().show(this.element);
+ this._editor.widget().on(UI.TextEditor.ContentChangedEvent, this._onContentChanged, this);
this.setText(this._initialText);
delete this._initialText;
@@ -43,6 +44,10 @@ Console.ConsolePrompt = class extends UI.Widget {
}
}
+ _onContentChanged() {
+ this.emit(new Console.ConsolePrompt.ContentChangedEvent());
+ }
+
/**
* @return {!Console.ConsoleHistoryManager}
*/
@@ -137,7 +142,6 @@ Console.ConsolePrompt = class extends UI.Widget {
this._editor.setSelection(Common.TextRange.createFromLocation(0, Infinity));
else
this.moveCaretToEndOfPrompt();
- this.setMinimumSize(0, this._editor.widget().element.offsetHeight);
}
/**
@@ -368,3 +372,6 @@ Console.ConsoleHistoryManager = class {
return this._data[this._data.length - this._historyOffset];
}
};
+
+/** @implements {Common.Emittable} */
+Console.ConsolePrompt.ContentChangedEvent = class {};

Powered by Google App Engine
This is Rietveld 408576698