Class: pointer

pointer


<private> new pointer()

A class that represents a WordPress pointer.
Since:
  • 3.3.0
Source:

Methods


<private> _handoff(extend)

Extends the pointer and the widget element with the supplied parameter, which is either an element or a function.
Parameters:
Name Type Description
extend Object The object to be merged into the original object.
Since:
  • 3.3.0
Source:
Returns:
The extended object.
Type
Object

<private> _open(event)

Opens and shows the pointer element.
Parameters:
Name Type Description
event Object An event object.
Since:
  • 3.3.0
Source:

<private> _processPosition(position)

Calculates the correct position based on a position in the settings.
Parameters:
Name Type Description
position string | Object Either a side of a pointer or an object containing a pointer.
Since:
  • 3.3.0
Source:
Returns:
result An object containing position related data.
Type
Object

<private> _setOption(key, value)

Sets an option on the pointer instance. There are 4 special values that do something extra: - `document` will transfer the pointer to the body of the new document specified by the value. - `pointerClass` will change the class of the pointer element. - `position` will reposition the pointer. - `content` will update the content of the pointer.
Parameters:
Name Type Description
key string The key of the option to set.
value * The value to set the option to.
Since:
  • 3.3.0
Source:

<private> _update(event, content)

Updates the content of the pointer. Will make sure that the pointer is correctly positioned.
Parameters:
Name Type Description
event Object The event that caused the update.
content * The content object. Either a string or a jQuery tree.
Since:
  • 3.3.0
Source:

close(event)

Closes and hides the pointer element.
Parameters:
Name Type Description
event Object An event object.
Since:
  • 3.3.0
Source:

destroy()

Removes the pointer element from of the DOM. Makes sure that the widget and all associated bindings are destroyed.
Since:
  • 3.3.0
Source:

open(event)

Opens the pointer. Only opens the pointer widget in case it is closed and not disabled, and calls 'update' before doing so. Calling update makes sure that the pointer is correctly sized and positioned.
Parameters:
Name Type Description
event Object The event that triggered the opening of this pointer.
Since:
  • 3.3.0
Source:

repoint()

Sets the arrow of the pointer to the correct side of the pointer element.
Since:
  • 3.3.0
Source:

reposition()

Repositions the pointer. Makes sure the pointer is the correct size for its content and makes sure it is positioned to point to the right element.
Since:
  • 3.3.0
Source:

sendToTop()

Puts the pointer on top by increasing the z-index.
Since:
  • 3.3.0
Source:

toggle(event)

Toggles the element between shown and hidden.
Parameters:
Name Type Description
event Object An event object.
Since:
  • 3.3.0
Source:

update(event)

Updates the content of the pointer. This function doesn't update the content of the pointer itself. That is done by the `_update` method. This method will make sure that the `_update` method is called with the right content. The content in the options can either be a string or a callback. If it is a callback the result of this callback is used as the content.
Parameters:
Name Type Description
event Object The event that caused the update.
Since:
  • 3.3.0
Source:
Returns:
Resolves when the update has been executed.
Type
Promise

widget()

Returns the pointer element.
Since:
  • 3.3.0
Source:
Returns:
Pointer The pointer object.
Type
Object