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

Unified Diff: chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js

Issue 2033473002: [Media Router WebUI] Fix search focus handlers when search is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
diff --git a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
index 0e1117d957afb2efa844db4355146f5631a62078..31d7e11de0849827ab7078c5ba64d8e3029004ed 100644
--- a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
+++ b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
@@ -436,7 +436,6 @@ Polymer({
this.$$('#focus-placeholder').remove();
document.addEventListener('keydown', this.onKeydown_.bind(this), true);
- this.setSearchFocusHandlers_();
this.listen(this, 'focus', 'onFocus_');
this.listen(this, 'header-height-changed', 'updateElementPositioning_');
this.listen(this, 'header-or-arrow-click', 'toggleCastModeHidden_');
@@ -2035,6 +2034,7 @@ Polymer({
searchEnabledChanged_: function(searchEnabled) {
if (searchEnabled) {
this.async(function() {
+ this.setSearchFocusHandlers_();
this.putSearchAtBottom_();
});
}
@@ -2060,7 +2060,6 @@ Polymer({
* @private
*/
setSearchFocusHandlers_: function() {
- var search = this.$$('#sink-search');
var searchInput = this.$$('#sink-search-input');
var that = this;
@@ -2076,15 +2075,13 @@ Polymer({
// |showSearchResults_()|.
window.addEventListener('blur', function() {
that.isSearchFocusedOnWindowBlur_ =
- that.shadowRoot.activeElement == search;
+ that.shadowRoot.activeElement == searchInput;
+ });
+ searchInput.addEventListener('focus', function() {
+ if (!that.isSearchFocusedOnWindowBlur_) {
+ that.showSearchResults_();
+ }
});
- if (this.hasConditionalElement_(search)) {
- searchInput.addEventListener('focus', function() {
- if (!that.isSearchFocusedOnWindowBlur_) {
- that.showSearchResults_();
- }
- });
- }
},
/**
« 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