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

Unified Diff: ui/login/bubble.js

Issue 2202583002: Hides the error bubble on scroll event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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: ui/login/bubble.js
diff --git a/ui/login/bubble.js b/ui/login/bubble.js
index 945cd4e1137f6494ec59532e7e3f82d1bb790b72..b860c6967b02d566f4ef961ad6af02e72f516ff4 100644
--- a/ui/login/bubble.js
+++ b/ui/login/bubble.js
@@ -61,6 +61,10 @@ cr.define('cr.ui', function() {
this.selfClickHandler_ = this.handleSelfClick_.bind(this);
this.ownerDocument.addEventListener('click',
this.handleDocClick_.bind(this));
+ // Set useCapture to true because scroll event does not bubble.
+ this.ownerDocument.addEventListener('scroll',
+ this.handleScroll_.bind(this),
+ true);
this.ownerDocument.addEventListener('keydown',
this.docKeyDownHandler_);
window.addEventListener('blur', this.handleWindowBlur_.bind(this));
@@ -301,6 +305,15 @@ cr.define('cr.ui', function() {
},
/**
+ * Handler of scroll event.
+ * @private
+ */
+ handleScroll_: function(e) {
+ if (!this.hidden)
+ this.hide();
+ },
+
+ /**
* Handler of document click event.
* @private
*/
« 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