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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/AdvancedSearchView.js

Issue 2657743003: DevTools: migrate icons in "search across files" to UI.Icon (Closed)
Patch Set: address comments Created 3 years, 11 months 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 | third_party/WebKit/Source/devtools/front_end/sources/sourcesSearch.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sources/AdvancedSearchView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/AdvancedSearchView.js b/third_party/WebKit/Source/devtools/front_end/sources/AdvancedSearchView.js
index 1bc8b2fcdcd6b99bc1d9c334a8337e56775e98a5..bfc38dffe0a91bc001b762af4bf593b0398af176 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/AdvancedSearchView.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/AdvancedSearchView.js
@@ -29,10 +29,14 @@ Sources.AdvancedSearchView = class extends UI.VBox {
this._search.setAttribute('results', '0');
this._search.setAttribute('size', 42);
- this._searchPanelElement.createChild('div', 'search-icon');
- this._searchInputClearElement = this._searchPanelElement.createChild('div', 'search-cancel-button');
- this._searchInputClearElement.hidden = true;
+ var searchIcon = UI.Icon.create('smallicon-search', 'search-icon');
+ this._searchPanelElement.appendChild(searchIcon);
+
+ this._searchInputClearElement = UI.Icon.create('smallicon-clear-input', 'search-cancel-button');
+ this._searchInputClearElement.classList.add('hidden');
this._searchInputClearElement.addEventListener('click', this._onSearchInputClear.bind(this), false);
+ var cancelButtonContainer = this._searchPanelElement.createChild('div', 'search-cancel-button-container');
+ cancelButtonContainer.appendChild(this._searchInputClearElement);
this._ignoreCaseLabel = UI.createCheckboxLabel(Common.UIString('Ignore case'));
this._ignoreCaseLabel.classList.add('search-config-label');
@@ -132,7 +136,7 @@ Sources.AdvancedSearchView = class extends UI.VBox {
_onSearchInputClear() {
this._search.value = '';
this.focus();
- this._searchInputClearElement.hidden = true;
+ this._searchInputClearElement.classList.add('hidden');
}
/**
@@ -319,10 +323,8 @@ Sources.AdvancedSearchView = class extends UI.VBox {
}
_onInput() {
- if (this._search.value && this._search.value.length)
- this._searchInputClearElement.hidden = false;
- else
- this._searchInputClearElement.hidden = true;
+ var hasText = this._search.value && this._search.value.length;
+ this._searchInputClearElement.classList.toggle('hidden', !hasText);
}
_save() {
@@ -335,7 +337,7 @@ Sources.AdvancedSearchView = class extends UI.VBox {
this._ignoreCaseCheckbox.checked = searchConfig.ignoreCase();
this._regexCheckbox.checked = searchConfig.isRegex();
if (this._search.value && this._search.value.length)
- this._searchInputClearElement.hidden = false;
+ this._searchInputClearElement.classList.remove('hidden');
}
_onAction() {
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sources/sourcesSearch.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698