MCPcopy
hub / github.com/dolphin-wood/smooth-scrollbar / addEvent

Function addEvent

demo/scripts/monitor.ts:122–131  ·  view source on GitHub ↗
(elems: EventTarget | EventTarget[], evts: string, handler: (e: Event) => void)

Source from the content-addressed store, hash-verified

120}
121
122function addEvent(elems: EventTarget | EventTarget[], evts: string, handler: (e: Event) => void) {
123 evts.split(/\s+/).forEach((name) => {
124 ([] as EventTarget[]).concat(elems).forEach((el) => {
125 el.addEventListener(name, (e) => {
126 handler(e);
127 shouldUpdate = true;
128 });
129 });
130 });
131}
132
133function sliceRecord(): RecordPoint[] {
134 const last = records[records.length - 1];

Callers 7

wheelHandlerFunction · 0.85
selectHandlerFunction · 0.85
mouseHandlerFunction · 0.85
keyboardHandlerFunction · 0.85
resizeHandlerFunction · 0.85
touchHandlerFunction · 0.85
monitor.tsFile · 0.85

Calls 1

handlerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…