Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js |
| index 85b150204d3ee5e014b9fd14a5a7f23e9f03415f..33348169bbbcf424e172a45365ab63f4fdc91197 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js |
| @@ -127,16 +127,18 @@ Elements.StylesSidebarPane = class extends Elements.ElementsSidebarPane { |
| * @param {string} placeholder |
| * @param {!Element} container |
| * @param {function(?RegExp)} filterCallback |
| + * @param {string=} activeClassName |
|
lushnikov
2017/06/08 23:23:40
should not be optional
luoe
2017/06/08 23:26:29
Done.
|
| * @return {!Element} |
| */ |
| - static createPropertyFilterElement(placeholder, container, filterCallback) { |
| + static createPropertyFilterElement(placeholder, container, filterCallback, activeClassName) { |
| var input = createElementWithClass('input'); |
| input.placeholder = placeholder; |
| function searchHandler() { |
| var regex = input.value ? new RegExp(input.value.escapeForRegExp(), 'i') : null; |
| filterCallback(regex); |
| - container.classList.toggle('styles-filter-engaged', !!input.value); |
| + if (activeClassName) |
|
lushnikov
2017/06/08 23:23:40
drop if
luoe
2017/06/08 23:26:29
Done.
|
| + container.classList.toggle(activeClassName, !!input.value); |
| } |
| input.addEventListener('input', searchHandler, false); |
| @@ -531,7 +533,7 @@ Elements.StylesSidebarPane = class extends Elements.ElementsSidebarPane { |
| var hbox = container.createChild('div', 'hbox styles-sidebar-pane-toolbar'); |
| var filterContainerElement = hbox.createChild('div', 'styles-sidebar-pane-filter-box'); |
| var filterInput = Elements.StylesSidebarPane.createPropertyFilterElement( |
| - Common.UIString('Filter'), hbox, this._onFilterChanged.bind(this)); |
| + Common.UIString('Filter'), hbox, this._onFilterChanged.bind(this), 'styles-filter-engaged'); |
| UI.ARIAUtils.setAccessibleName(filterInput, Common.UIString('Filter Styles')); |
| filterContainerElement.appendChild(filterInput); |
| var toolbar = new UI.Toolbar('styles-pane-toolbar', hbox); |