MCPcopy Index your code
hub / github.com/gridstack/gridstack.js / on

Method on

src/dd-gridstack.ts:186–196  ·  view source on GitHub ↗
(el: GridItemHTMLElement, name: string, callback: DDCallback)

Source from the content-addressed store, hash-verified

184 }
185
186 public on(el: GridItemHTMLElement, name: string, callback: DDCallback): DDGridStack {
187 this._getDDElements(el).forEach(dEl =>
188 dEl.on(name, (event: Event) => {
189 callback(
190 event,
191 DDManager.dragElement ? DDManager.dragElement.el : event.target as GridItemHTMLElement,
192 DDManager.dragElement ? DDManager.dragElement.helper : null)
193 })
194 );
195 return this;
196 }
197
198 public off(el: GridItemHTMLElement, name: string): DDGridStack {
199 this._getDDElements(el).forEach(dEl => dEl.off(name));

Callers

nothing calls this directly

Calls 1

_getDDElementsMethod · 0.95

Tested by

no test coverage detected