MCPcopy
hub / github.com/NUKnightLab/TimelineJS3 / fire

Method fire

src/js/core/Events.js:96–117  ·  view source on GitHub ↗

* Activate (execute) all registered callback functions for the given * type, passing the given data, if any. * @param {string} type * @param {object} [data] * @returns { Events } this (the instance upon which the method was called)

(type, data)

Source from the content-addressed store, hash-verified

94 * @returns { Events } this (the instance upon which the method was called)
95 */
96 fire(type, data) {
97 if (!this.hasEventListeners(type)) {
98 return this;
99 }
100
101 var event = mergeData({
102 type: type,
103 target: this
104 }, data);
105
106 var listeners = this._tl_events[type].slice();
107
108 for (var i = 0, len = listeners.length; i < len; i++) {
109 if (listeners[i].action) {
110 listeners[i].action.call(listeners[i].context || this, event);
111 } else {
112 trace(`no action defined for ${type} listener`)
113 }
114 }
115
116 return this;
117 }
118
119};

Callers 15

onLoadedMethod · 0.80
onMediaLoadedMethod · 0.80
onAddMethod · 0.80
onRemoveMethod · 0.80
onLoadedMethod · 0.80
onAddMethod · 0.80
onRemoveMethod · 0.80
onLoadedMethod · 0.80
onAddMethod · 0.80
onRemoveMethod · 0.80
_onMouseClickMethod · 0.80
setZoomFactorMethod · 0.80

Calls 3

hasEventListenersMethod · 0.95
mergeDataFunction · 0.90
traceFunction · 0.90

Tested by

no test coverage detected