Skip to main content

ensemble.Event

ensemble#

ensemble~Event#

Event is an event manager.

It is a wrapper around the native Event [DOM].

Kind: inner class of ensemble
See

  • Element.addEventListener()
  • Element.removeElementListener()

new Event(ns, name, node)#

Constructor method.

ParamTypeDescription
nsstringEvent namespace
namestringThe [DOM] Event type name
nodeElementA valid Element node -or- component

Example

new ensemble.Event('namespace-of-my-foo-component', 'mousewheel', node).add(func, { capture: true });

event._Symbol.toStringTag โ‡’ string#

Getter for Symbol property, returns the symbolic name for ensemble.Event class.

Kind: instance property of Event
See: Symbol.toStringTag
Todo

  • return undef
  • backward compatibility

event.add(handle, options)#

Adds an event for this composition.

Kind: instance method of Event
See: Element.addEventListener()

ParamTypeDefaultDescription
handlefunctionThe function handler
optionsmixedfalseAn options Object -or- useCapture boolean

event.remove(handle)#

Removes an event from this composition.

Kind: instance method of Event
See: Element.removeElementListener()
Todo

  • ? removes handle ref.
ParamTypeDescription
handlefunctionThe function handler

Event.isEvent() โ‡’ boolean#

Check if passed object is an ensemble.Event instance.

Kind: static method of Event
Todo

  • backward compatibility