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

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

Issue 2474143002: DevTools: Rename prefix to query in the context of autocomplete (Closed)
Patch Set: merge Created 4 years, 1 month 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 983a0e56fb3e591d64d26db67590540caaee32bf..0d7ac04e4de2ccd9afa93c0b8f7ba120c15b5f51 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
@@ -270,19 +270,19 @@ WebInspector.SuggestBox = class {
}
/**
- * @param {string} prefix
+ * @param {string} query
* @param {string} text
* @param {string=} className
* @return {!Element}
*/
- _createItemElement(prefix, text, className) {
+ _createItemElement(query, text, className) {
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;
- element.createChild('span', 'suffix').textContent = text.substring(prefix.length).trimEnd(50);
+ if (query && query.length && !text.indexOf(query)) {
+ element.createChild('span', 'query').textContent = query;
+ element.createChild('span').textContent = text.substring(query.length).trimEnd(50);
} else {
- element.createChild('span', 'suffix').textContent = text.trimEnd(50);
+ element.createChild('span').textContent = text.trimEnd(50);
}
element.__fullValue = text;
element.createChild('span', 'spacer');
@@ -374,7 +374,7 @@ WebInspector.SuggestBox = class {
if (completions.length > 1)
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.
+ // Do not show a single suggestion if it is the same as user-entered query, even if allowed to show single-item suggest boxes.
return canShowForSingleItem && completions[0].title !== userEnteredText;
}

Powered by Google App Engine
This is Rietveld 408576698