MCPcopy Create free account
hub / github.com/breck7/scroll / dispatchEvent

Function dispatchEvent

external/.d3.js:2460–2473  ·  view source on GitHub ↗
(node, type, params)

Source from the content-addressed store, hash-verified

2458}
2459
2460function dispatchEvent(node, type, params) {
2461 var window = defaultView(node),
2462 event = window.CustomEvent;
2463
2464 if (typeof event === "function") {
2465 event = new event(type, params);
2466 } else {
2467 event = window.document.createEvent("Event");
2468 if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;
2469 else event.initEvent(type, false, false);
2470 }
2471
2472 node.dispatchEvent(event);
2473}
2474
2475function dispatchConstant(type, params) {
2476 return function() {

Callers 2

dispatchConstantFunction · 0.85
dispatchFunctionFunction · 0.85

Calls 1

defaultViewFunction · 0.85

Tested by

no test coverage detected