Chromium Code Reviews| Index: ui/webui/resources/js/cr/ui/bubble.js |
| diff --git a/ui/webui/resources/js/cr/ui/bubble.js b/ui/webui/resources/js/cr/ui/bubble.js |
| index 95318a4f1f2808a2ae330bc6a1087915b41cfe06..36ffb59d33ec4f923cc708803d090a73d10d91c4 100644 |
| --- a/ui/webui/resources/js/cr/ui/bubble.js |
| +++ b/ui/webui/resources/js/cr/ui/bubble.js |
| @@ -477,6 +477,8 @@ cr.define('cr.ui', function() { |
| * outside the bubble and its target element, scrolls the underlying |
| * document or resizes the window. |
| * @param {Event} event The event. |
| + * @suppress {checkTypes} |
| + * TODO(vitalyp): remove the suppression. |
| */ |
| handleEvent: function(event) { |
| BubbleBase.prototype.handleEvent.call(this, event); |
| @@ -486,14 +488,15 @@ cr.define('cr.ui', function() { |
| // left-click on the bubble's target element (allowing the target to |
| // handle the event and close the bubble itself). |
| case 'mousedown': |
| - if (event.button == 0 && |
| - this.anchorNode_.contains(assertInstanceof(event.target, Node))) { |
| + var target = assertInstanceof(event.target, Node); |
| + if (event.button == 0 && this.anchorNode_.contains(target)) { |
|
Dan Beam
2014/10/02 02:54:38
nit: no curlies
Vitaly Pavlenko
2014/10/02 18:18:22
Done.
|
| break; |
| } |
| // Close the bubble when the underlying document is scrolled. |
| case 'mousewheel': |
| case 'scroll': |
| - if (this.contains(assertInstanceof(event.target, Node))) |
| + var target = assertInstanceof(event.target, Node); |
| + if (this.contains(target)) |
| break; |
| // Close the bubble when the window is resized. |
| case 'resize': |