Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function attachListeners(id) {
- const elements = document.querySelectorAll(`.${id}`);
- elements.forEach(element => {
- switch(id) {
- case 'view':
- element.addEventListener('mousemove', handleViewPortalHover);
- element.addEventListener('mouseover', handleViewPortalHover);
- element.addEventListener('click', handleViewPortalClick);
- break;
- case 'tray':
- element.addEventListener('mousemove', handleTrayPortalHover);
- element.addEventListener('mouseover', handleTrayPortalHover);
- element.addEventListener('click', handleTrayPortalClick);
- break;
- case 'viewframe':
- element.addEventListener('click', handleViewFrameClick);
- break;
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement