| 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 a6e2903d948d3a9a25e72f293d7aa2f70a5f8e26..e3009a1019c0fd23cbaf7dc909b6bf5c9d0daedd 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
|
| @@ -70,6 +70,11 @@ WebInspector.SuggestBox = function(suggestBoxDelegate, maxItemsHeight)
|
| this._asyncDetailsPromises = /** @type {!Map<number, !Promise>} */ ({});
|
| }
|
|
|
| +/**
|
| + * @typedef Array.<{title: string, className: (string|undefined)}>
|
| + */
|
| +WebInspector.SuggestBox.Suggestions;
|
| +
|
| WebInspector.SuggestBox.prototype = {
|
| /**
|
| * @return {boolean}
|
| @@ -239,11 +244,12 @@ WebInspector.SuggestBox.prototype = {
|
| /**
|
| * @param {string} prefix
|
| * @param {string} text
|
| + * @param {string|undefined} className
|
| * @param {number} index
|
| */
|
| - _createItemElement: function(prefix, text, index)
|
| + _createItemElement: function(prefix, text, className, index)
|
| {
|
| - var element = createElementWithClass("div", "suggest-box-content-item source-code");
|
| + var element = createElementWithClass("div", "suggest-box-content-item source-code " + (className || ""));
|
| element.tabIndex = -1;
|
| if (prefix && prefix.length && !text.indexOf(prefix)) {
|
| element.createChild("span", "prefix").textContent = prefix;
|
| @@ -258,7 +264,7 @@ WebInspector.SuggestBox.prototype = {
|
| },
|
|
|
| /**
|
| - * @param {!Array.<string>} items
|
| + * @param {!WebInspector.SuggestBox.Suggestions} items
|
| * @param {string} userEnteredText
|
| * @param {function(number): !Promise<{detail:string, description:string}>=} asyncDetails
|
| */
|
| @@ -272,7 +278,7 @@ WebInspector.SuggestBox.prototype = {
|
|
|
| for (var i = 0; i < items.length; ++i) {
|
| var item = items[i];
|
| - var currentItemElement = this._createItemElement(userEnteredText, item, i);
|
| + var currentItemElement = this._createItemElement(userEnteredText, item.title, item.className, i);
|
| this._element.appendChild(currentItemElement);
|
| }
|
| },
|
| @@ -337,7 +343,7 @@ WebInspector.SuggestBox.prototype = {
|
| },
|
|
|
| /**
|
| - * @param {!Array.<string>} completions
|
| + * @param {!WebInspector.SuggestBox.Suggestions} completions
|
| * @param {boolean} canShowForSingleItem
|
| * @param {string} userEnteredText
|
| */
|
| @@ -350,7 +356,7 @@ WebInspector.SuggestBox.prototype = {
|
| return true;
|
|
|
| // Do not show a single suggestion if it is the same as user-entered prefix, even if allowed to show single-item suggest boxes.
|
| - return canShowForSingleItem && completions[0] !== userEnteredText;
|
| + return canShowForSingleItem && completions[0].title !== userEnteredText;
|
| },
|
|
|
| _ensureRowCountPerViewport: function()
|
| @@ -365,7 +371,7 @@ WebInspector.SuggestBox.prototype = {
|
|
|
| /**
|
| * @param {!AnchorBox} anchorBox
|
| - * @param {!Array.<string>} completions
|
| + * @param {!WebInspector.SuggestBox.Suggestions} completions
|
| * @param {number} selectedIndex
|
| * @param {boolean} canShowForSingleItem
|
| * @param {string} userEnteredText
|
|
|