| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // require: event_tracker.js | 5 // require: event_tracker.js |
| 6 | 6 |
| 7 cr.define('cr.ui', function() { | 7 cr.define('cr.ui', function() { |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Bubble is a free-floating informational bubble with a triangular arrow | 10 * Bubble is a free-floating informational bubble with a triangular arrow |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 }, | 35 }, |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * Sets the anchor node, i.e. the node that this bubble points at. | 38 * Sets the anchor node, i.e. the node that this bubble points at. |
| 39 * @param {HTMLElement} node The new anchor node. | 39 * @param {HTMLElement} node The new anchor node. |
| 40 */ | 40 */ |
| 41 set anchorNode(node) { | 41 set anchorNode(node) { |
| 42 this.anchorNode_ = node; | 42 this.anchorNode_ = node; |
| 43 | 43 |
| 44 if (!this.hidden) | 44 if (!this.hidden) |
| 45 reposition(); | 45 this.reposition(); |
| 46 }, | 46 }, |
| 47 | 47 |
| 48 /** | 48 /** |
| 49 * Updates the position of the bubble. This is automatically called when | 49 * Updates the position of the bubble. This is automatically called when |
| 50 * the window is resized, but should also be called any time the layout | 50 * the window is resized, but should also be called any time the layout |
| 51 * may have changed. | 51 * may have changed. |
| 52 */ | 52 */ |
| 53 reposition: function() { | 53 reposition: function() { |
| 54 var node = this.anchorNode_; | 54 var node = this.anchorNode_; |
| 55 var clientRect = node.getBoundingClientRect(); | 55 var clientRect = node.getBoundingClientRect(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 e.stopPropagation(); | 108 e.stopPropagation(); |
| 109 e.preventDefault(); | 109 e.preventDefault(); |
| 110 return; | 110 return; |
| 111 }, | 111 }, |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 return { | 114 return { |
| 115 Bubble: Bubble | 115 Bubble: Bubble |
| 116 }; | 116 }; |
| 117 }); | 117 }); |
| OLD | NEW |