MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / on

Function on

static/js/codemirror/codemirror.js:4848–4858  ·  view source on GitHub ↗
(emitter, type, f)

Source from the content-addressed store, hash-verified

4846 // EVENT HANDLING
4847
4848 function on(emitter, type, f) {
4849 if (emitter.addEventListener)
4850 emitter.addEventListener(type, f, false);
4851 else if (emitter.attachEvent)
4852 emitter.attachEvent("on" + type, f);
4853 else {
4854 var map = emitter._handlers || (emitter._handlers = {});
4855 var arr = map[type] || (map[type] = []);
4856 arr.push(f);
4857 }
4858 }
4859
4860 function off(emitter, type, f) {
4861 if (emitter.removeEventListener)

Callers 5

registerEventHandlersFunction · 0.85
onMouseDownFunction · 0.85
onContextMenuFunction · 0.85
codemirror.jsFile · 0.85
SharedTextMarkerFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected