OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Bubble implementation. | 6 * @fileoverview Bubble implementation. |
7 */ | 7 */ |
8 | 8 |
9 // TODO(xiyuan): Move this into shared. | 9 // TODO(xiyuan): Move this into shared. |
10 cr.define('cr.ui', function() { | 10 cr.define('cr.ui', function() { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 this.selfClickHandler_ = this.handleSelfClick_.bind(this); | 61 this.selfClickHandler_ = this.handleSelfClick_.bind(this); |
62 this.ownerDocument.addEventListener('click', | 62 this.ownerDocument.addEventListener('click', |
63 this.handleDocClick_.bind(this)); | 63 this.handleDocClick_.bind(this)); |
64 // Set useCapture to true because scroll event does not bubble. | 64 // Set useCapture to true because scroll event does not bubble. |
65 this.ownerDocument.addEventListener('scroll', | 65 this.ownerDocument.addEventListener('scroll', |
66 this.handleScroll_.bind(this), | 66 this.handleScroll_.bind(this), |
67 true); | 67 true); |
68 this.ownerDocument.addEventListener('keydown', | 68 this.ownerDocument.addEventListener('keydown', |
69 this.docKeyDownHandler_); | 69 this.docKeyDownHandler_); |
70 window.addEventListener('blur', this.handleWindowBlur_.bind(this)); | 70 window.addEventListener('blur', this.handleWindowBlur_.bind(this)); |
71 this.addEventListener('webkitTransitionEnd', | 71 this.addEventListener('transitionend', |
72 this.handleTransitionEnd_.bind(this)); | 72 this.handleTransitionEnd_.bind(this)); |
73 // Guard timer for 200ms + epsilon. | 73 // Guard timer for 200ms + epsilon. |
74 ensureTransitionEndEvent(this, 250); | 74 ensureTransitionEndEvent(this, 250); |
75 }, | 75 }, |
76 | 76 |
77 /** | 77 /** |
78 * Element that should be focused on hide. | 78 * Element that should be focused on hide. |
79 * @type {HTMLElement} | 79 * @type {HTMLElement} |
80 */ | 80 */ |
81 set elementToFocusOnHide(value) { | 81 set elementToFocusOnHide(value) { |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 handleWindowBlur_: function(e) { | 405 handleWindowBlur_: function(e) { |
406 if (!this.hidden) | 406 if (!this.hidden) |
407 this.hide(); | 407 this.hide(); |
408 } | 408 } |
409 }; | 409 }; |
410 | 410 |
411 return { | 411 return { |
412 Bubble: Bubble | 412 Bubble: Bubble |
413 }; | 413 }; |
414 }); | 414 }); |
OLD | NEW |