Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private initEvents() {
const self = this
const graph = this.graph;
const canvas = graph.get('canvas');
const el = canvas.get('el');
const extendEvents = this.extendEvents;
const canvasHandler: Fun = wrapBehavior(self, 'onCanvasEvents') as Fun;
const originHandler = wrapBehavior(self, 'onExtendEvents');
const wheelHandler = wrapBehavior(self, 'onWheelEvent');
each(EVENTS, event => {
canvas.on(event, canvasHandler);
});
this.canvasHandler = canvasHandler;
extendEvents.push(addEventListener(el, 'DOMMouseScroll', wheelHandler));
extendEvents.push(addEventListener(el, 'mousewheel', wheelHandler));
if (typeof window !== 'undefined') {
extendEvents.push(addEventListener(window as any, 'keydown', originHandler));
extendEvents.push(addEventListener(window as any, 'keyup', originHandler));
}
}
const graph = this.graph;
const canvas = graph.get('canvas');
const el = canvas.get('el');
const extendEvents = this.extendEvents;
const canvasHandler: Fun = wrapBehavior(self, 'onCanvasEvents') as Fun;
const originHandler = wrapBehavior(self, 'onExtendEvents');
const wheelHandler = wrapBehavior(self, 'onWheelEvent');
each(EVENTS, event => {
canvas.on(event, canvasHandler);
});
this.canvasHandler = canvasHandler;
extendEvents.push(addEventListener(el, 'DOMMouseScroll', wheelHandler));
extendEvents.push(addEventListener(el, 'mousewheel', wheelHandler));
if (typeof window !== 'undefined') {
extendEvents.push(addEventListener(window as any, 'keydown', originHandler));
extendEvents.push(addEventListener(window as any, 'keyup', originHandler));
}
}
private initEvents() {
const self = this
const graph = this.graph;
const canvas = graph.get('canvas');
const el = canvas.get('el');
const extendEvents = this.extendEvents;
const canvasHandler: Fun = wrapBehavior(self, 'onCanvasEvents') as Fun;
const originHandler = wrapBehavior(self, 'onExtendEvents');
const wheelHandler = wrapBehavior(self, 'onWheelEvent');
each(EVENTS, event => {
canvas.on(event, canvasHandler);
});
this.canvasHandler = canvasHandler;
extendEvents.push(addEventListener(el, 'DOMMouseScroll', wheelHandler));
extendEvents.push(addEventListener(el, 'mousewheel', wheelHandler));
if (typeof window !== 'undefined') {
extendEvents.push(addEventListener(window as any, 'keydown', originHandler));
extendEvents.push(addEventListener(window as any, 'keyup', originHandler));
}
}
const self = this
const graph = this.graph;
const canvas = graph.get('canvas');
const el = canvas.get('el');
const extendEvents = this.extendEvents;
const canvasHandler: Fun = wrapBehavior(self, 'onCanvasEvents') as Fun;
const originHandler = wrapBehavior(self, 'onExtendEvents');
const wheelHandler = wrapBehavior(self, 'onWheelEvent');
each(EVENTS, event => {
canvas.on(event, canvasHandler);
});
this.canvasHandler = canvasHandler;
extendEvents.push(addEventListener(el, 'DOMMouseScroll', wheelHandler));
extendEvents.push(addEventListener(el, 'mousewheel', wheelHandler));
if (typeof window !== 'undefined') {
extendEvents.push(addEventListener(window as any, 'keydown', originHandler));
extendEvents.push(addEventListener(window as any, 'keyup', originHandler));
}
}