| Index: chrome/browser/resources/chromeos/login/bubble.js
|
| diff --git a/chrome/browser/resources/chromeos/login/bubble.js b/chrome/browser/resources/chromeos/login/bubble.js
|
| index 7b1bf2fab2cbf58c60cd2be401f4afee27fbf6a3..248762317436f3d665c283d2b6c2d96f021d4595 100644
|
| --- a/chrome/browser/resources/chromeos/login/bubble.js
|
| +++ b/chrome/browser/resources/chromeos/login/bubble.js
|
| @@ -33,23 +33,20 @@ cr.define('cr.ui', function() {
|
|
|
| /**
|
| * Shows the bubble for given anchor element.
|
| - * @param {!HTMLElement} el Anchor element of the bubble.
|
| + * @param {number} x X position of bubble's reference point.
|
| + * @param {number} y Y position of bubble's reference point.
|
| * @param {HTMLElement} content Content to show in bubble.
|
| * @public
|
| */
|
| - showContentForElement: function(el, content) {
|
| + showContentAt: function(x, y, content) {
|
| const ARROW_OFFSET = 14;
|
| - const HORIZONTAL_PADDING = 10;
|
| - const VERTICAL_PADDING = 5;
|
|
|
| - var elementOrigin = Oobe.getOffset(el);
|
| - var anchorX = elementOrigin.left + HORIZONTAL_PADDING - ARROW_OFFSET;
|
| - var anchorY = elementOrigin.top + el.offsetHeight + VERTICAL_PADDING;
|
| + var anchorX = x - ARROW_OFFSET;
|
| + var anchorY = y;
|
|
|
| this.style.left = anchorX + 'px';
|
| this.style.top = anchorY + 'px';
|
|
|
| - this.anchor_ = el;
|
| this.innerHTML = '';
|
| this.appendChild(content);
|
| this.hidden = false;
|
| @@ -59,6 +56,24 @@ cr.define('cr.ui', function() {
|
| /**
|
| * Shows the bubble for given anchor element.
|
| * @param {!HTMLElement} el Anchor element of the bubble.
|
| + * @param {HTMLElement} content Content to show in bubble.
|
| + * @public
|
| + */
|
| + showContentForElement: function(el, content) {
|
| + const HORIZONTAL_PADDING = 10;
|
| + const VERTICAL_PADDING = 5;
|
| +
|
| + var elementOrigin = Oobe.getOffset(el);
|
| + var anchorX = elementOrigin.left + HORIZONTAL_PADDING;
|
| + var anchorY = elementOrigin.top + el.offsetHeight + VERTICAL_PADDING;
|
| +
|
| + this.anchor_ = el;
|
| + this.showContentAt(anchorX, anchorY, content);
|
| + },
|
| +
|
| + /**
|
| + * Shows the bubble for given anchor element.
|
| + * @param {!HTMLElement} el Anchor element of the bubble.
|
| * @param {string} text Text content to show in bubble.
|
| * @public
|
| */
|
|
|