Class: EventBinder

EventBinder()

Responsible for binding event listeners to DOM elements based on attributes. Uses event delegation on the root element.

Constructor

new EventBinder()

Source:

Methods

bind(root, dispatcher)

Binds event listeners to all elements under the root that have attributes starting with '@'. Uses event delegation on Element roots, falls back to direct binding on DocumentFragments.

Parameters:
Name Type Description
root Element | DocumentFragment

The root element to bind events on.

dispatcher Object

The object responsible for executing the event handler.

Properties
Name Type Description
execute function

Method to execute the event.

Source:

unbind(root)

Removes all event listeners for the given root.

Parameters:
Name Type Description
root Element | DocumentFragment
Source: