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

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

Issue 2577953004: DevTools: convert UI.ComboBoxFilterUI to use vanilla <select> element (Closed)
Patch Set: address comment Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js b/third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js
index 9a758c29ac180672af79659209679296abfe6b62..75cde638da34e9193ba7a0dd5774d92460383a7d 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js
@@ -491,16 +491,18 @@ UI.ComboBoxFilterUI = class extends Common.Object {
this._filterElement.className = 'filter-combobox-filter';
this._options = options;
- this._filterComboBox = new UI.ToolbarComboBox(this._filterChanged.bind(this));
+ this._filterComboBox = createElementWithClass('select', 'chrome-select');
+ this._filterComboBox.addEventListener('input', this._filterChanged.bind(this), false);
for (var i = 0; i < options.length; ++i) {
var filterOption = options[i];
var option = createElement('option');
option.text = filterOption.label;
option.title = filterOption.title;
- this._filterComboBox.addOption(option);
- this._filterComboBox.element.title = this._filterComboBox.selectedOption().title;
+ this._filterComboBox.appendChild(option);
}
- this._filterElement.appendChild(this._filterComboBox.element);
+ if (options.length)
+ this._filterComboBox.title = options[0].title;
+ this._filterElement.appendChild(this._filterComboBox);
}
/**
@@ -508,7 +510,7 @@ UI.ComboBoxFilterUI = class extends Common.Object {
* @return {boolean}
*/
isActive() {
- return this._filterComboBox.selectedIndex() !== 0;
+ return this._filterComboBox.selectedIndex !== 0;
}
/**
@@ -523,7 +525,7 @@ UI.ComboBoxFilterUI = class extends Common.Object {
* @return {*}
*/
value() {
- var option = this._options[this._filterComboBox.selectedIndex()];
+ var option = this._options[this._filterComboBox.selectedIndex];
return option.value;
}
@@ -531,22 +533,22 @@ UI.ComboBoxFilterUI = class extends Common.Object {
* @param {number} index
*/
setSelectedIndex(index) {
- this._filterComboBox.setSelectedIndex(index);
+ this._filterComboBox.selectedIndex = index;
}
/**
* @return {number}
*/
selectedIndex(index) {
- return this._filterComboBox.selectedIndex();
+ return this._filterComboBox.selectedIndex;
}
/**
* @param {!Event} event
*/
_filterChanged(event) {
- var option = this._options[this._filterComboBox.selectedIndex()];
- this._filterComboBox.element.title = option.title;
+ var option = this._options[this._filterComboBox.selectedIndex];
+ this._filterComboBox.title = option.title;
this.dispatchEventToListeners(UI.FilterUI.Events.FilterChanged, null);
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698