ui.HoverCard Extends goog.ui.AdvancedTooltip
Create a hover card object. Hover cards extend tooltips in that they don't have to be manually attached to each element that can cause them to display. Instead, you can create a function that gets called when the mouse goes over any element on your page, and returns whether or not the hovercard should be shown for that element. Alternatively, you can define a map of tag names to the attribute name each tag should have for that tag to trigger the hover card. See example below. Hovercards can also be triggered manually by calling triggerForElement, shown without a delay by calling showForElement, or triggered over other elements by calling attach. For the latter two cases, the application is responsible for calling detach when finished. HoverCard objects fire a TRIGGER event when the mouse moves over an element that can trigger a hovercard, and BEFORE_SHOW when the hovercard is about to be shown. Clients can respond to these events and can prevent the hovercard from being triggered or shown.

Inheritance

Constructor

goog.ui.HoverCard(isAnchoropt_checkDescendantsopt_domHelperopt_triggeringDocument)

Parameters

isAnchor : Function | Object
Function that returns true if a given element should trigger the hovercard. Alternatively, it can be a map of tag names to the attribute that the tag should have in order to trigger the hovercard, e.g., {A: 'href'} for all links. Tag names must be all upper case; attribute names are case insensitive.
opt_checkDescendants : boolean=
Use false for a performance gain if you are sure that none of your triggering elements have child elements. Default is true.
opt_domHelper : goog.dom.DomHelper=
Optional DOM helper to use for creating and rendering the hovercard element.
opt_triggeringDocument : Document=
Optional document to use in place of the one included in the DomHelper for finding triggering elements. Defaults to the document included in the DomHelper.

Instance Methods

Public Protected Private
cancelTrigger()
Abort pending hovercard showing, if any.
code »
detachTempAnchor_(anchor)
If given anchor is in the list of temporarily attached anchors, then detach and remove from the list.
Arguments:
anchor : Element | undefined
Anchor element that we may want to detach from.
code »
disposeInternal()
No description.
code »
getAnchorElement() Element
Gets the DOM element that triggered the current hovercard. Note that in the TRIGGER or CANCEL_TRIGGER events, the current hovercard's anchor may not be the one that caused the event, so use the event's anchor property instead.
Returns: Element  Object that caused the currently displayed hovercard (or pending hovercard if none is displayed) to be triggered.
code »
handleMouseOutAndBlur(event)
If the mouse moves out of the trigger while we're being triggered, then cancel it.
Arguments:
event : goog.events.BrowserEvent
Mouse out or blur event.
code »
handleMouseOver(event)
This mouse over event is only received if the anchor is already attached. If it was attached manually, then it may need to be triggered.
Arguments:
event : goog.events.BrowserEvent
Mouse over event.
code »
handleTriggerMouseOver_(e)
If the user mouses over an element with the correct tag and attribute, then trigger the hovercard for that element. If anchors could have children, then we also need to check the parent chain of the given element.
Arguments:
e : goog.events.Event
Mouse over event.
code »
isAnchor_(node) boolean
This function can be overridden by passing a function as the first parameter to the constructor.
Arguments:
node : Node
Node to test.
Returns: boolean  Whether or not hovercard should be shown.
code »
maybeCancelTrigger_()
If hovercard is in the process of being triggered, then cancel it.
code »
maybeShow(elopt_pos)
Called by timer from mouse over handler. If this is called and the hovercard is not shown for whatever reason, then send a cancel trigger event.
Arguments:
el : Element
Element to show tooltip for.
opt_pos : goog.positioning.AbstractPosition=
Position to display popup at.
code »
onCancelTrigger()
This method gets called when we detect that a trigger event will not lead to the hovercard being shown.
code »
onHide_()
Make sure we detach from temp anchor when we are done displaying hovercard.
code »
onTrigger(triggerEvent) boolean
Called when an element triggers the hovercard. This will return false if an event handler sets preventDefault to true, which will prevent the hovercard from being shown.
Arguments:
triggerEvent : !goog.ui.HoverCard.TriggerEvent
Event object to use for trigger event.
Returns: boolean  Whether hovercard should be shown or cancelled.
code »
setCurrentAnchor_(anchor)
Sets the current anchor element at the time that the hovercard is shown.
Arguments:
anchor : Element
New current anchor element, or null if there is no current anchor.
code »
setMaxSearchSteps(maxSearchSteps)
Sets the max number of levels to search up the dom if checking descendants.
Arguments:
maxSearchSteps : number
Maximum number of levels to search up the dom if checking descendants.
code »
triggerForElement(anchorElementopt_posopt_data)
Triggers the hovercard to show after a delay.
Arguments:
anchorElement : Element
Element that is triggering the hovercard.
opt_pos : goog.positioning.AbstractPosition=
Position to display hovercard.
opt_data : Object=
Data to pass to the onTrigger event.
code »
getCursorTracking() boolean
No description.
Returns: boolean  Whether to track the cursor and thereby close the tooltip if it moves away from the tooltip and keep it open if it moves towards it.
code »
getCursorTrackingHideDelayMs() number
No description.
Returns: number  The delay in milliseconds before tooltips are hidden if cursor tracking is enabled and the cursor is moving away from the tooltip.
code »
getHideDelayMs() number
Override hide delay with cursor tracking hide delay while tracking.
Returns: number  Hide delay to use.
code »
getHotSpotPadding() goog.math.Box
No description.
Returns: goog.math.Box  box The margin around the tooltip where the cursor is allowed without dismissing the tooltip.
code »
handleMouseMove(event)
Handler for mouse move events.
Arguments:
event : goog.events.BrowserEvent
Event object.
code »
handleTooltipMouseOver(event)
Handler for mouse over events for the tooltip element.
Arguments:
event : goog.events.BrowserEvent
Event object.
code »
isCoordinateActive_(coord) boolean
Checks if supplied coordinate is in the tooltip, its triggering anchor, or a tooltip that has been triggered by a child of this tooltip. Called from handleMouseMove to determine if hide timer should be started, and from maybeHide to determine if tooltip should be hidden.
Arguments:
coord : goog.math.Coordinate
Coordinate being tested.
Returns: boolean  Whether coordinate is in the anchor, the tooltip, or any tooltip whose anchor is a child of this tooltip.
code »
isCoordinateInTooltip(coord) boolean
Checks whether the supplied coordinate is inside the tooltip, including padding if any.
Arguments:
coord : goog.math.Coordinate
Coordinate being tested.
Returns: boolean  Whether the coord is in the tooltip.
code »
isMouseInTooltip() boolean
Returns true if the mouse is in the tooltip.
Returns: boolean  True if the mouse is in the tooltip.
code »
maybeHide(el)
Called by timer from mouse out handler. Hides tooltip if cursor is still outside element and tooltip.
Arguments:
el : Element
Anchor when hide timer was started.
code »
onHide_()
Called after the popup is hidden.
code »
onShow_()
Called after the popup is shown.
code »
resetHotSpot()
Not ever necessary to call this function. Hot spot is calculated as neccessary. Forces the recalculation of the hotspot on the next mouse over event.
code »
setCursorTracking(b)
Sets whether to track the cursor and thereby close the tooltip if it moves away from the tooltip and keep it open if it moves towards it.
Arguments:
b : boolean
Whether to track the cursor.
code »
setCursorTrackingHideDelayMs(delay)
Sets delay in milliseconds before tooltips are hidden if cursor tracking is enabled and the cursor is moving away from the tooltip.
Arguments:
delay : number
The delay in milliseconds.
code »
setHotSpotPadding(opt_box)
Sets margin around the tooltip where the cursor is allowed without dismissing the tooltip.
Arguments:
opt_box : goog.math.Box=
The margin around the tooltip.
code »
attach(el)
Attach to element. Tooltip will be displayed when the cursor is over the element or when the element has been active for a few milliseconds.
Arguments:
el : Element | string
Element to display tooltip for, either element reference or string id.
code »
checkForParentTooltip_()
Looks for an active tooltip whose element contains this tooltip's anchor. This allows us to prevent hides until they are really necessary.
code »
clearHideTimer()
Helper method called to clear the close timer.
code »
clearShowTimer()
Helper method called to clear the show timer.
code »
detach(opt_el)
Detach from element(s).
Arguments:
opt_el : Element | string=
Element to detach from, either element reference or string id. If no element is specified all are detached.
code »
detachElement_(el)
Detach from element.
Arguments:
el : Element
Element to detach from.
code »
disposeInternal()
No description.
code »
getActiveElement() Element
No description.
Returns: Element  Active element reference.
code »
getAnchorFromElement(el) Element
Find anchor containing the given element, if any.
Arguments:
el : Element
Element that triggered event.
Returns: Element  Element in elements_ array that contains given element, or null if not found.
code »
getChildTooltip() goog.ui.Tooltip
No description.
Returns: goog.ui.Tooltip  Active tooltip in a child element, or null if none.
code »
getDomHelper() goog.dom.DomHelper
Returns the dom helper that is being used on this component.
Returns: goog.dom.DomHelper  The dom helper used on this component.
code »
getElements() goog.structs.Set
No description.
Returns: goog.structs.Set  Elements this widget is attached to.
code »
getHideDelayMs() number
No description.
Returns: number  The delay in milliseconds before tooltip is hidden once the cursor leaves the element.
code »
getHtml() string
No description.
Returns: string  The tooltip message as HTML as plain string.
code »
getPositioningStrategy(activationType) !goog.positioning.AbstractPosition
Return a Position instance for repositioning the tooltip. Override in subclasses to customize the way repositioning is done.
Arguments:
activationType : goog.ui.Tooltip.Activation
Information about what kind of event caused the popup to be shown.
Returns: !goog.positioning.AbstractPosition  The position object used to position the tooltip.
code »
getShowDelayMs() number
No description.
Returns: number  The delay in milliseconds before tooltip is displayed for an element.
code »
getState() goog.ui.Tooltip.State
No description.
Returns: goog.ui.Tooltip.State  Current state of tooltip.
code »
getText() string
No description.
Returns: string  The tooltip message as plain text.
code »
handleFocus(event)
Handler for focus events.
Arguments:
event : goog.events.BrowserEvent
Event object.
code »
handleMouseMove(event)
Handler for mouse move events.
Arguments:
event : goog.events.BrowserEvent
MOUSEMOVE event.
code »
handleMouseOutAndBlur(event)
Handler for mouse out and blur events.
Arguments:
event : goog.events.BrowserEvent
Event object.
code »
handleMouseOver(event)
Handler for mouse over events.
Arguments:
event : goog.events.BrowserEvent
Event object.
code »
handleTooltipMouseOut(event)
Handler for mouse out events for the tooltip element.
Arguments:
event : goog.events.BrowserEvent
Event object.
code »
handleTooltipMouseOver(event)
Handler for mouse over events for the tooltip element.
Arguments:
event : goog.events.BrowserEvent
Event object.
code »
hasActiveChild() boolean
No description.
Returns: boolean  Whether tooltip element contains an active child tooltip, and should thus not be hidden. When the child tooltip is hidden, it will check if the parent should be hidden, too.
code »
isCoordinateInTooltip(coord) boolean
Returns true if the coord is in the tooltip.
Arguments:
coord : goog.math.Coordinate
Coordinate being tested.
Returns: boolean  Whether the coord is in the tooltip.
code »
maybeHide(el)
Called by timer from mouse out handler. Hides tooltip if cursor is still outside element and tooltip, or if a child of tooltip has the focus.
Arguments:
el : Element
Tooltip's anchor when hide timer was started.
code »
maybeShow(elopt_pos)
Called by timer from mouse over handler. Shows tooltip if cursor is still over the same element.
Arguments:
el : Element
Element to show tooltip for.
opt_pos : goog.positioning.AbstractPosition=
Position to display popup at.
code »
onBeforeShow() boolean
Called before the popup is shown.
Returns: boolean  Whether tooltip should be shown.
code »
onHide_()
Called after the popup is hidden.
code »
positionAndShow_(elopt_pos)
Sets tooltip position and shows it.
Arguments:
el : Element
Element to show tooltip for.
opt_pos : goog.positioning.AbstractPosition=
Position to display popup at.
code »
saveCursorPosition_(event)
Saves the current mouse cursor position to this.cursorPosition.
Arguments:
event : goog.events.BrowserEvent
MOUSEOVER or MOUSEMOVE event.
code »
setActiveElement(activeEl)
No description.
Arguments:
activeEl : Element
Active element reference.
code »
setElement(el)
Sets tooltip element.
Arguments:
el : Element
HTML element to use as the tooltip.
code »
setHideDelayMs(delay)
Sets delay in milliseconds before tooltip is hidden once the cursor leavs the element.
Arguments:
delay : number
The delay in milliseconds.
code »
setHtml(str)
Sets tooltip message as HTML markup. using goog.html.SafeHtml are in place.
Arguments:
str : string
HTML message to display in tooltip.
code »
setRequireInteraction(requireInteraction)
Sets whether tooltip requires the mouse to have moved or the anchor receive focus before the tooltip will be shown.
Arguments:
requireInteraction : boolean
Whether tooltip should require some user interaction before showing tooltip.
code »
setSafeHtml(html)
Sets tooltip message as HTML markup.
Arguments:
html : !goog.html.SafeHtml
HTML message to display in tooltip.
code »
setShowDelayMs(delay)
Sets delay in milliseconds before tooltip is displayed for an element.
Arguments:
delay : number
The delay in milliseconds.
code »
setText(str)
Sets tooltip message as plain text.
Arguments:
str : string
Text message to display in tooltip.
code »
showForElement(elopt_pos)
Shows tooltip for a specific element.
Arguments:
el : Element
Element to show tooltip for.
opt_pos : goog.positioning.AbstractPosition=
Position to display popup at.
code »
startHideTimer()
Helper method called to start the close timer.
code »
startShowTimer(elopt_pos)
Helper method, starts timer that calls maybeShow. Parameters are passed to the maybeShow method.
Arguments:
el : Element
Element to show tooltip for.
opt_pos : goog.positioning.AbstractPosition=
Position to display popup at.
code »
Defined in goog.ui.Popup
getMargin() ?goog.math.Box
Returns the margin to place around the popup.
Returns: ?goog.math.Box  The margin.
code »
getPinnedCorner() goog.positioning.Corner
Returns the corner of the popup to used in the positioning algorithm.
Returns: goog.positioning.Corner  The popup corner used for positioning.
code »
No description.
Returns: goog.positioning.AbstractPosition  The position helper object associated with the popup.
code »
reposition()
Repositions the popup according to the current state.
code »
setMargin(arg1opt_arg2opt_arg3opt_arg4)
Sets the margin to place around the popup.
Arguments:
arg1 : goog.math.Box | number | null
Top value or Box.
opt_arg2 : number=
Right value.
opt_arg3 : number=
Bottom value.
opt_arg4 : number=
Left value.
code »
setPinnedCorner(corner)
Sets the corner of the popup to used in the positioning algorithm.
Arguments:
corner : goog.positioning.Corner
The popup corner used for positioning.
code »
setPosition(position)
Sets the position helper object associated with the popup.
Arguments:
position : goog.positioning.AbstractPosition
A position helper object.
code »
addAutoHidePartner(partner)
Mouse events that occur within an autoHide partner will not hide a popup set to autoHide.
Arguments:
partner : !Element
The auto hide partner element.
code »
continueHidingPopup_(opt_target)
Continues hiding the popup. This is a continuation from hide_. It is a separate method so that we can add a transition before hiding.
Arguments:
opt_target : Object=
Target of the event causing the hide.
code »
disposeInternal()
No description.
code »
ensureNotVisible_()
Helper to throw exception if the popup is showing.
code »
getAutoHide() boolean
Returns whether the Popup dismisses itself when the user clicks outside of it.
Returns: boolean  Whether the Popup autohides on an external click.
code »
getAutoHideRegion() Element
Returns the region inside which the Popup dismisses itself when the user clicks, or null if it's the entire document.
Returns: Element  The DOM element for autohide, or null if it hasn't been set.
code »
getElement() Element
Returns the dom element that should be used for the popup.
Returns: Element  The popup element.
code »
getEnableCrossIframeDismissal() boolean
No description.
Returns: boolean  Whether cross iframe dismissal is enabled.
code »
getHandler() goog.events.EventHandler.<T>
Returns the event handler for the popup. All event listeners belonging to this handler are removed when the tooltip is hidden. Therefore, the recommended usage of this handler is to listen on events in #onShow_.
Returns: goog.events.EventHandler.<T>  Event handler for this popup.
code »
getHideOnEscape() boolean
No description.
Returns: boolean  Whether the Popup autohides on the escape key.
code »
getLastHideTime() number
Returns the time when the popup was last hidden.
Returns: number  time in ms since epoch when the popup was last hidden, or -1 if the popup was never hidden or is currently showing.
code »
getLastShowTime() number
Returns the time when the popup was last shown.
Returns: number  time in ms since epoch when the popup was last shown, or -1 if the popup was never shown.
code »
getType() goog.ui.PopupBase.Type
No description.
Returns: goog.ui.PopupBase.Type  The type of popup this is.
code »
hidePopupElement()
Hides the popup element.
code »
hide_(opt_target) boolean
Hides the popup. This call is idempotent.
Arguments:
opt_target : Object=
Target of the event causing the hide.
Returns: boolean  Whether the popup was hidden and not cancelled.
code »
isOrWasRecentlyVisible() boolean
Returns whether the popup is currently visible or was visible within about 150 ms ago. This is used by clients to handle a very specific, but common, popup scenario. The button that launches the popup should close the popup on mouse down if the popup is alrady open. The problem is that the popup closes itself during the capture phase of the mouse down and thus the button thinks it's hidden and this should show it again. This method provides a good heuristic for clients. Typically in their event handler they will have code that is: if (menu.isOrWasRecentlyVisible()) { menu.setVisible(false); } else { ... // code to position menu and initialize other state menu.setVisible(true); }
Returns: boolean  Whether the popup is currently visible or was visible within about 150 ms ago.
code »
isOrWithinAutoHidePartner_(element) boolean
No description.
Arguments:
element : Node
The element to inspect.
Returns: boolean  Returns true if the given element is one of the auto hide partners or is a child of an auto hide partner.
code »
isVisible() boolean
Returns whether the popup is currently visible.
Returns: boolean  whether the popup is currently visible.
code »
isWithinAutoHideRegion_(element) boolean
No description.
Arguments:
element : Node
The element to inspect.
Returns: boolean  Returns true if the element is contained within the autohide region. If unset, the autohide region is the entire entire document.
code »
moveOffscreen_()
Hides the popup by moving it offscreen.
code »
onBeforeHide_(opt_target) boolean
Called before the popup is hidden. Derived classes can override to hook this event but should make sure to call the parent class method.
Arguments:
opt_target : Object=
Target of the event causing the hide.
Returns: boolean  If anyone called preventDefault on the event object (or if any of the handlers returns false this will also return false.
code »
onBeforeShow() boolean
Called before the popup is shown. Derived classes can override to hook this event but should make sure to call the parent class method.
Returns: boolean  If anyone called preventDefault on the event object (or if any of the handlers returns false this will also return false.
code »
onDocumentBlur_(e)
Deactivate handler(IE) and blur handler (other browsers) for document. Used to hide the popup for auto-hide mode.
Arguments:
e : goog.events.BrowserEvent
The event object.
code »
onDocumentKeyDown_(e)
Handles key-downs on the document to handle the escape key.
Arguments:
e : goog.events.BrowserEvent
The event object.
code »
onDocumentMouseDown_(e)
Mouse down handler for the document on capture phase. Used to hide the popup for auto-hide mode.
Arguments:
e : goog.events.BrowserEvent
The event object.
code »
onHide_(opt_target)
Called after the popup is hidden. Derived classes can override to hook this event but should make sure to call the parent class method.
Arguments:
opt_target : Object=
Target of the event causing the hide.
code »
onShow_()
Called after the popup is shown. Derived classes can override to hook this event but should make sure to call the parent class method.
code »
removeAutoHidePartner(partner)
Removes a previously registered auto hide partner.
Arguments:
partner : !Element
The auto hide partner element.
code »
reposition()
Repositions the popup according to the current state. Should be overriden by subclases.
code »
setAutoHide(autoHide)
Sets whether the Popup dismisses itself when the user clicks outside of it.
Arguments:
autoHide : boolean
Whether to autohide on an external click.
code »
setAutoHideRegion(element)
Sets the region inside which the Popup dismisses itself when the user clicks.
Arguments:
element : Element
The DOM element for autohide.
code »
setElement(elt)
Specifies the dom element that should be used for the popup.
Arguments:
elt : Element
A DOM element for the popup.
code »
setEnableCrossIframeDismissal(enable)
Sets whether clicks in other iframes should dismiss this popup. In some cases it should be disabled, because it can cause spurious
Arguments:
enable : boolean
Whether to enable cross iframe dismissal.
code »
setHideOnEscape(hideOnEscape)
Sets whether the Popup dismisses itself on the escape key.
Arguments:
hideOnEscape : boolean
Whether to autohide on the escape key.
code »
setShouldHideAsync(b)
Sets whether the popup should hide itself asynchronously using a timeout instead of synchronously.
Arguments:
b : boolean
Whether to hide async.
code »
setTransition(opt_showTransitionopt_hideTransition)
Sets transition animation on showing and hiding the popup.
Arguments:
opt_showTransition : goog.fx.Transition=
Transition to play on showing the popup.
opt_hideTransition : goog.fx.Transition=
Transition to play on hiding the popup.
code »
setType(type)
Specifies the type of popup to use.
Arguments:
type : goog.ui.PopupBase.Type
Type of popup.
code »
setVisible(visible)
Sets whether the popup should be visible. After this method returns, isVisible() will always return the new state, even if there is a transition.
Arguments:
visible : boolean
Desired visibility state.
code »
shouldDebounce_() boolean
No description.
Returns: boolean  Whether the time since last show is less than the debounce delay.
code »
shouldHideAsync() boolean
Returns whether the popup should hide itself asynchronously using a timeout instead of synchronously.
Returns: boolean  Whether to hide async.
code »
showPopupElement()
Shows the popup element.
code »
show_()
Does the work to show the popup.
code »
addEventListener(typeopt_captureopt_handlerScope)
Use #listen instead, when possible. Otherwise, use goog.events.listen if you are passing Object (instead of Function) as handler. Adds an event listener to the event target. The same handler can only be added once per the type. Even if you add the same handler multiple times using the same type then it will only be called once when the event is dispatched.
Arguments:
type : string
The type of the event to listen for.
: ?function():? | ?{handleEvent:function():?
No description.
opt_capture : boolean=
In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.
opt_handlerScope : Object=
Object in whose scope to call the listener.
code »
assertInitialized_()
Asserts that the event target instance is initialized properly.
code »
dispatchEvent()
No description.
code »
disposeInternal()
Removes listeners from this object. Classes that extend EventTarget may need to override this method in order to remove references to DOM Elements and additional listeners.
code »
fireListeners()
No description.
code »
getListener()
No description.
code »
getListeners()
No description.
code »
getParentEventTarget() goog.events.EventTarget
Returns the parent of this event target to use for bubbling.
Returns: goog.events.EventTarget  The parent EventTarget or null if there is no parent.
code »
hasListener()
No description.
code »
listen()
No description.
code »
listenOnce()
No description.
code »
removeAllListeners()
No description.
code »
removeEventListener(typeopt_captureopt_handlerScope)
Use #unlisten instead, when possible. Otherwise, use goog.events.unlisten if you are passing Object (instead of Function) as handler. Removes an event listener from the event target. The handler must be the same object as the one added. If the handler has not been added then nothing is done.
Arguments:
type : string
The type of the event to listen for.
: ?function():? | ?{handleEvent:function():?
No description.
opt_capture : boolean=
In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.
opt_handlerScope : Object=
Object in whose scope to call the listener.
code »
setParentEventTarget(parent)
Sets the parent of this event target to use for capture/bubble mechanism.
Arguments:
parent : goog.events.EventTarget
Parent listenable (null if none).
code »
setTargetForTesting(target)
Sets the target to be used for event.target when firing event. Mainly used for testing. For example, see goog.testing.events.mixinListenable.
Arguments:
target : !Object
The target.
code »
unlisten()
No description.
code »
unlistenByKey()
No description.
code »
addOnDisposeCallback(callbackopt_scope)
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.
Arguments:
callback : function(this:T):?
The callback function.
opt_scope : T=
An optional scope to call the callback in.
code »
dispose() void
Disposes of the object. If the object hasn't already been disposed of, calls #disposeInternal. Classes that extend goog.Disposable should override #disposeInternal in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.
Returns: void  Nothing.
code »
disposeInternal()
Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend goog.Disposable should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass' disposeInternal method. Everywhere else the public dispose method must be used. For example:
  mypackage.MyClass = function() {
    mypackage.MyClass.base(this, 'constructor');
    // Constructor logic specific to MyClass.
    ...
  };
  goog.inherits(mypackage.MyClass, goog.Disposable);

  mypackage.MyClass.prototype.disposeInternal = function() {
    // Dispose logic specific to MyClass.
    ...
    // Call superclass's disposeInternal at the end of the subclass's, like
    // in C++, to avoid hard-to-catch issues.
    mypackage.MyClass.base(this, 'disposeInternal');
  };
code »
getDisposed() boolean
Use #isDisposed instead. No description.
Returns: boolean  Whether the object has been disposed of.
code »
isDisposed() boolean
No description.
Returns: boolean  Whether the object has been disposed of.
code »
registerDisposable(disposable)
Associates a disposable object with this object so that they will be disposed together.
Arguments:
disposable : goog.disposable.IDisposable
that will be disposed when this object is disposed.
code »

Instance Properties

anchors_ :
Map of tag names to attribute names that will trigger a hovercard.
Code »
checkDescendants_ :
Whether anchors may have child elements. If true, then we need to check the parent chain of any mouse over event to see if any of those elements could be anchors. Default is true.
Code »
constructor :
No description.
Code »
currentAnchor_ :
Anchor of hovercard currently being shown. This may be different from anchor property if a second hovercard is triggered, when anchor becomes the second hovercard while currentAnchor_ is still the old (but currently displayed) anchor.
Code »
document_ :
Document containing the triggering elements, to which we listen for mouseover events.
Code »
maxSearchSteps_ :
Maximum number of levels to search up the dom when checking descendants.
Code »
tempAttachedAnchors_ :
Array of anchor elements that should be detached when we are no longer associated with them.
Code »
anchorBox_ : goog.math.Box
Anchor bounding box.
Code »
boundingBox_ : goog.math.Box
Bounding box.
Code »
constructor :
No description.
Code »
cursorTrackingHideDelayMs_ :
Delay in milliseconds before tooltips are hidden if cursor tracking is enabled and the cursor is moving away from the tooltip.
Code »
cursorTracking_ :
Whether to track the cursor and thereby close the tooltip if it moves away from the tooltip and keep it open if it moves towards it.
Code »
hotSpotPadding_ : goog.math.Box
Box object representing a margin around the tooltip where the cursor is allowed without dismissing the tooltip.
Code »
tracking_ :
Whether the cursor tracking is active.
Code »
activeEl_ :
Active element reference. Used by the delayed show functionality to keep track of the element the mouse is over or the element with focus.
Code »
anchor :
Element that triggered the tooltip. Note that if a second element triggers this tooltip, anchor becomes that second element, even if its show is cancelled and the original tooltip survives.
Code »
childTooltip_ : goog.ui.Tooltip
If this tooltip's element contains another tooltip that becomes active, this property identifies that tooltip so that we can check if this tooltip should not be hidden because the nested tooltip is active.
Code »
className :
CSS class name for tooltip.
Code »
constructor :
No description.
Code »
cursorPosition : goog.math.Coordinate
Cursor position relative to the page.
Code »
Dom Helper
Code »
elements_ : goog.structs.Set
Elements this widget is attached to.
Code »
hideDelayMs_ :
Delay in milliseconds before tooltips are hidden.
Code »
hideTimer :
Timer for when to hide.
Code »
parentTooltip_ : goog.ui.Tooltip
If this tooltip is inside another tooltip's element, then it may have prevented that tooltip from hiding. When this tooltip hides, we'll need to check if the parent should be hidden as well.
Code »
requireInteraction_ :
Whether the cursor must have moved before the tooltip will be shown.
Code »
seenInteraction_ :
Whether the anchor has seen the cursor move or has received focus since the tooltip was last shown. Used to ignore mouse over events triggered by view changes and UI updates.
Code »
showDelayMs_ :
Delay in milliseconds since the last mouseover or mousemove before the tooltip is displayed for an element.
Code »
showTimer :
Timer for when to show.
Code »
Defined in goog.ui.Popup
constructor :
No description.
Code »
margin_ : goog.math.Box
Margin for the popup used in positioning algorithms.
Code »
popupCorner_ :
Corner of the popup to used in the positioning algorithm.
Code »
Positioning helper object.
Code »
autoHidePartners_ :
Mouse events without auto hide partner elements will not dismiss the popup.
Code »
autoHideRegion_ :
Clicks outside the popup but inside this element will cause the popup to hide if autoHide_ is true. If this is null, then the entire document is used. For example, you can use a body-size div so that clicks on the browser scrollbar do not dismiss the popup.
Code »
autoHide_ :
Whether the Popup dismisses itself it the user clicks outside of it or the popup loses focus
Code »
constructor :
No description.
Code »
element_ :
The popup dom element that this Popup wraps.
Code »
enableCrossIframeDismissal_ :
Whether to enable cross-iframe dismissal.
Code »
An event handler to manage the events easily
Code »
hideOnEscape_ :
Whether to hide when the escape key is pressed.
Code »
hideTransition_ : goog.fx.Transition
Transition to play on hiding the popup.
Code »
isVisible_ :
Whether the popup is currently being shown.
Code »
lastHideTime_ :
The time when the popup was last hidden.
Code »
lastShowTime_ :
The time when the popup was last shown.
Code »
shouldHideAsync_ :
Whether the popup should hide itself asynchrously. This was added because there are cases where hiding the element in mouse down handler in IE can cause textinputs to get into a bad state if the element that had focus is hidden.
Code »
showTransition_ : goog.fx.Transition
Transition to play on showing the popup.
Code »
type_ :
The type of popup
Code »
actualEventTarget_ : goog.events.EventTarget
The object to use for event.target. Useful when mixing in an EventTarget to another object.
Code »
constructor :
No description.
Code »
eventTargetListeners_ : goog.events.ListenerMap
Maps of event type to an array of listeners.
Code »
parentEventTarget_ : goog.events.EventTarget
Parent event target, used during event bubbling. TODO(user): Change this to goog.events.Listenable. This currently breaks people who expect getParentEventTarget to return goog.events.EventTarget.
Code »
creationStack :
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.
Code »
disposed_ :
Whether the object has been disposed of.
Code »
onDisposeCallbacks_ :
Callbacks to invoke when this object is disposed.
Code »

Static Properties

goog.ui.HoverCard.superClass_ :
No description.
Code »

Enumerations

goog.ui.HoverCard.EventType :
Enum for event type fired by HoverCard.
Constants:
BEFORE_HIDE
No description.
BEFORE_SHOW
No description.
CANCEL_TRIGGER
No description.
HIDE
No description.
SHOW
No description.
TRIGGER
No description.
Code »

Package ui

Package Reference