Methods
resume(targets, events, handleropt, nullable) → {Number}
Resumes (a), previously paused, event listener(s). Subsequent executions of the handler will fire again.
The definition of targets and events works exactly as in "on" and "once", the only difference being, that the handler is optional in this case, which results in the un-pausing of all handlers, without targeting a specific one.
To specifically target handlers without a namespace, please use the namespace-string "__default".
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
targets |
EventTarget | Array.<EventTarget> | the target(s) to resume event handlers on |
||
events |
String | Array.<String> | the event name(s) to resume, can be either a single name or a list of names, each name may also have a namespace, separated by a dot, to target all events/namespaces, you may use ""/".*" |
||
handler |
function |
<optional> <nullable> |
null | a specific callback function to resume |
Throws:
-
error in case no targets are defined
-
error in case no events are defined
-
error in case a defined handler is not a function
-
error in case targets are not all usable event targets
-
error in case delegations are missing viable ancestor targets
Returns:
- Type
- Number
Example
resume(linkElement, '*', fSpecificHandler);
resume(customEventElement, ['*.test', '*.site']);
resume([ancestorElement, 'a', ancestorElement, '.btn[data-foobar="test"]'], '*.*', fSpecificHandler);
resume(buttonElement, '*.*');