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

Unified Diff: Source/devtools/front_end/ui/HistoryInput.js

Issue 1179943002: DevTools: history input should overwrite last history entry with user-input (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/HistoryInput.js
diff --git a/Source/devtools/front_end/ui/HistoryInput.js b/Source/devtools/front_end/ui/HistoryInput.js
index f2251e663d60bf89b08b68e5dbbfcab1af7aeb94..54daad1e1836375e4ca2b68186b965b9167d9560 100644
--- a/Source/devtools/front_end/ui/HistoryInput.js
+++ b/Source/devtools/front_end/ui/HistoryInput.js
@@ -27,6 +27,16 @@ WebInspector.HistoryInput.prototype = {
this._history = [""];
this._historyPosition = 0;
this.addEventListener("keydown", this._onKeyDown.bind(this), false);
+ this.addEventListener("input", this._onInput.bind(this), false);
+ },
+
+ /**
+ * @param {!Event} event
+ */
+ _onInput: function(event)
+ {
+ if (this._history.length === this._historyPosition + 1)
+ this._history[this._history.length - 1] = this.value;
},
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698