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

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

Issue 2742573007: DevTools: initial console suggestion should be greyed out (Closed)
Patch Set: use another css 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/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 592de32a64e1774b10448e9529c00147bac73ef0..06d7a9c6ea20b68ef227a0a1d6812961d4031bb0 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
@@ -78,6 +78,21 @@ UI.SuggestBox = class {
}
/**
+ * @param {boolean} value
+ */
+ setDefaultSelectionIsDimmed(value) {
+ this._element.classList.toggle('default-selection-is-dimmed', value);
+ }
+
+ /**
+ * @param {boolean} value
+ */
+ _setUserInteracted(value) {
+ this._userInteracted = value;
+ this._element.classList.toggle('user-has-interacted', value);
+ }
+
+ /**
* @return {boolean}
*/
visible() {
@@ -137,7 +152,7 @@ UI.SuggestBox = class {
hide() {
if (!this.visible())
return;
- this._userInteracted = false;
+ this._setUserInteracted(false);
this._glassPane.hide();
}
@@ -209,7 +224,7 @@ UI.SuggestBox = class {
element.addEventListener('click', event => {
this._list.selectItem(item);
- this._userInteracted = true;
+ this._setUserInteracted(true);
event.consume(true);
this.acceptSuggestion();
});
@@ -335,7 +350,7 @@ UI.SuggestBox = class {
return false;
}
if (selected) {
- this._userInteracted = true;
+ this._setUserInteracted(true);
return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698