Chromium Code Reviews| 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 0704bbcffb9818408df613e4904e5fe681dbb0db..269339e075427d17e0ca56d8c658876354b82515 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.TextChangedEvent, this._onTextChanged, this); |
|
pfeldman
2017/03/24 22:28:33
You don't know that the widget is editor, this cal
luoe
2017/03/28 17:40:41
einbinder@, wdyt about adding a text changed handl
luoe
2017/03/31 02:18:08
Done, Updated TextEditor to extend Common.EventTar
|
| this.setText(this._initialText); |
| delete this._initialText; |
| @@ -43,6 +44,10 @@ Console.ConsolePrompt = class extends UI.Widget { |
| } |
| } |
| + _onTextChanged() { |
| + this.emit(new Console.ConsolePrompt.TextChangedEvent()); |
| + } |
| + |
| /** |
| * @return {!Console.ConsoleHistoryManager} |
| */ |
| @@ -75,6 +80,7 @@ Console.ConsolePrompt = class extends UI.Widget { |
| this._editor.setText(text); |
| else |
| this._initialText = text; |
| + this.emit(new Console.ConsolePrompt.TextChangedEvent()); |
| } |
| /** |
| @@ -137,7 +143,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 +373,6 @@ Console.ConsoleHistoryManager = class { |
| return this._data[this._data.length - this._historyOffset]; |
| } |
| }; |
| + |
| +/** @implements {Common.Emittable} */ |
| +Console.ConsolePrompt.TextChangedEvent = class {}; |