APIs

Show:

Mixin containing logic making available to handle DOM-events related to component as inner & outer component's actions. Also contains methods to attach custom handlers for DOM-events with delayed clean up logic which will be executed before component will be destroyed.

Methods

attachEventHandler

(
  • options
)

Attaches event handler for a given event-target. Also remembers attached handlers and related event-targets for clean up logic which will be executed before component will be destroyed, so use this method instead of explicit calls to jQuery.on method to avoid possible memory leaks.

Parameters:

closeModalDialog

()

Close current modal window if it exists.

createdModalDialog

(
  • modalDialog
)

Handles create modal window action. It saves created window to have opportunity to close it later.

Parameters:

  • modalDialog JQuery

    Created modal window.

detachAllEventHandlers

()

Detaches all event-handlers remembered in metadata when event-handlers were attached through 'attachEventHandler' method.

detachEventHandler

(
  • options
)

Detaches event-handler from a given event-target. Also cleans up metadata remembered when event-handler was attached through 'attachEventHandler' method.

Parameters:

send

(
  • actionName
  • args
)
Any

Overridden 'send' method. Method logic still the same, but method now returns value returned by the action handler.

Parameters:

  • actionName String

    Name of the action that must be triggered.

  • args

    Arguments that must be passed to action.

Returns:

Any:

Returns value returned by action handler.

Properties

_availableDomEvents

Object private

Dictionary containing names of DOM-events available for component's wrapping DOM-element and component's actions names related to them.

_eventsMetadata

Object[] private

Array with objects containing selected event targets & handlers attached to them. Each object in array has following structure: { eventTarget: ..., attachedEventHandlers: { click: [function() {}, function() {}, ...], dblclick: [function() {}, function() {}, ...], ... } }.

Default: null

_openedModalDialog

JQuery

Current opened modal window.

Default: undefined

isTagless

Boolean

Flag: indicates whether component is tagless or not (has empty tagName or not).