Skip to content

Commit

Permalink
Extract duplicate fn
Browse files Browse the repository at this point in the history
  • Loading branch information
surrsurus committed May 30, 2024
1 parent 5cb7564 commit e696e8d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions assets/js/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ function prepareCanvas() {
if (keys[key] !== undefined) keys[key] = false;
});

canvas.addEventListener('blur', (_e) => Object.keys(keys).forEach(key => keys[key] = false));
window.addEventListener('blur', (_e) => Object.keys(keys).forEach(key => keys[key] = false));
const disableInput = (_e) => Object.keys(keys).forEach(key => keys[key] = false);
canvas.addEventListener('blur', disableInput);
window.addEventListener('blur', disableInput);

window.addEventListener('resize', (_e) => {
camera_rig.resize();
Expand Down

0 comments on commit e696e8d

Please sign in to comment.