source: imaps-frontend/src/scripts/util/addEventHandling.js

main
Last change on this file was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago

Pred finalna verzija

  • Property mode set to 100644
File size: 384 bytes
RevLine 
[0c6b92a]1export const addEventHandling = (shape, map, action) => {
2 shape.on(action, () => {
3 const eventName = shape.eventName;
4 if (eventName) {
5 const data = {
6 room: shape,
7 map: map,
8 };
9 const event = new CustomEvent(eventName, { detail: data });
10 window.dispatchEvent(event);
11 }
12 });
13}
Note: See TracBrowser for help on using the repository browser.