Home

# Class goog.ui.Bubble

The Bubble provides a general purpose bubble implementation that can be anchored to a particular element and displayed for a period of time.

extends goog.ui.Component

Instance Method Summary
| `attach(?Element anchorElement)` Attaches the bubble to an anchor element. Computes the positioning and orientation of the bubble.
| `computeHtmlForCorner_(?goog.positioning.Corner corner) ⇒ string` Computes the HTML string for a given bubble orientation.
| `computePinnedCorner_(?Element anchorElement) ⇒ ?goog.positioning.Corner` Computes the pinned corner for the bubble.
| `configureElement_()` Creates element's contents and configures all timers. This is called on setVisible(true).
| `createDom()` Creates the initial DOM representation for the component. The default implementation is to set this.element_ = div.
| `createMarginForCorner_(?goog.positioning.Corner corner) ⇒ ?goog.math.Box` Computes the right offset for a given bubble corner and creates a margin element for it. This is done to have the button anchor element on its frame rather than on the corner.
| `disposeInternal()` Disposes of the component. Calls {@code exitDocument}, which is expected to remove event handlers and clean up the component. Propagates the call to the component's children, if any. Removes the component's DOM from the document unless it was decorated.
| `getComputedAnchoredPosition(?Element anchorElement) ⇒ ?goog.ui.Popup.AnchoredPosition` Returns an AnchoredPosition that will position the bubble optimally given the position of the anchor element and the size of the viewport.
| `hideBubble_()` Hides the bubble. This is called asynchronously by timer of event processor for the mouse click on the close button.
| `isVisible() ⇒ boolean`
| `setAnchoredPosition_(?Element anchorElement, ?goog.positioning.Corner corner)` Computes bubble position based on anchored element.
| `setAutoHide(boolean autoHide)` Sets whether the bubble should be automatically hidden whenever user clicks outside the bubble element.
| `setPinnedCorner(?goog.positioning.Corner corner)` Sets the corner of the bubble to used in the positioning algorithm.
| `setPosition(?goog.positioning.AbstractPosition position)` Sets the position of the bubble. Pass null for corner in AnchoredPosition for corner to be computed automatically.
| `setTimeout(number timeout)` Sets the timeout after which bubble hides itself.
| `setVisible(boolean visible)` Sets whether the bubble should be visible.
| `unconfigureElement_()` Gets rid of the element's contents and all assoicated timers and listeners. This is called on dispose as well as on setVisible(false).