Chromium Code Reviews| 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; |