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

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: 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..b4b1cfb403327f5f9e6b2fe677f3ce65bd93cb9e 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
@@ -60,6 +60,7 @@ UI.SuggestBox = class {
this._captureEnter = captureEnter;
this._rowHeight = 17;
this._userInteracted = false;
+ this._userInteractionStyling = false;
this._userEnteredText = '';
/** @type {?string} */
this._onlyCompletion = null;
@@ -78,6 +79,22 @@ UI.SuggestBox = class {
}
/**
+ * @param {boolean} value
+ */
+ setUserInteractionStyling(value) {
+ this._userInteractionStyling = value;
dgozman 2017/03/11 00:00:24 Drop it.
lushnikov 2017/03/11 00:09:59 Done.
+ this._element.classList.toggle('enable-interaction-styling', value);
+ }
+
+ /**
+ * @param {boolean} value
+ */
+ _setUserInteracted(value) {
+ this._userInteracted = value;
+ this._element.classList.toggle('user-has-interacted', value);
+ }
+
+ /**
* @return {boolean}
*/
visible() {
@@ -137,7 +154,7 @@ UI.SuggestBox = class {
hide() {
if (!this.visible())
return;
- this._userInteracted = false;
+ this._setUserInteracted(false);
this._glassPane.hide();
}
@@ -209,7 +226,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 +352,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