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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js

Issue 2749363002: DevTools: greyed-out console suggestion should not clash with console history (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/suggestBox.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js b/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
index 06d7a9c6ea20b68ef227a0a1d6812961d4031bb0..922a5aa96b3367f4f26cddd99b57283f08975c7e 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
@@ -61,6 +61,8 @@ UI.SuggestBox = class {
this._rowHeight = 17;
this._userInteracted = false;
this._userEnteredText = '';
+ this._defaultSelectionIsDimmed = false;
+
/** @type {?string} */
this._onlyCompletion = null;
@@ -81,6 +83,7 @@ UI.SuggestBox = class {
* @param {boolean} value
*/
setDefaultSelectionIsDimmed(value) {
+ this._defaultSelectionIsDimmed = value;
this._element.classList.toggle('default-selection-is-dimmed', value);
}
@@ -259,8 +262,11 @@ UI.SuggestBox = class {
selectedItemChanged(from, to, fromElement, toElement) {
if (fromElement)
fromElement.classList.remove('selected', 'force-white-icons');
- if (toElement)
- toElement.classList.add('selected', 'force-white-icons');
+ if (toElement) {
+ toElement.classList.add('selected');
+ if (fromElement || this._userInteracted || !this._defaultSelectionIsDimmed)
dgozman 2017/03/15 21:17:43 Why check for |fromElement|?
lushnikov 2017/03/16 08:25:46 In this case the _userInteracted is not yet update
+ toElement.classList.add('force-white-icons');
+ }
if (!to)
return;
this._applySuggestion(true);
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/suggestBox.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698