Skip to content

Commit

Permalink
Addressing PR comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
fkurmannucsc committed Jul 3, 2024
1 parent 1c384cf commit a706380
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function initVideo(info) {
</div>
`;

removeKeydownSideEffects();
removeHotkeysOnText();
}

function toggleSelection() {
Expand Down Expand Up @@ -258,7 +258,7 @@ function addScreenshot(screenshot) {

document.querySelector('.screenshot-area').insertAdjacentHTML('afterbegin', html);

removeKeydownSideEffects();
removeHotkeysOnText();
}

// Flip a screenshot by adding it the the canvas flipped horizontally or vertically.
Expand Down Expand Up @@ -466,9 +466,11 @@ function initializeHotkeys() {
save();
}
});

removeHotkeysOnText();
}

function removeKeydownSideEffects() {
function removeHotkeysOnText() {
document.querySelectorAll('input[type="text"]').forEach((input) => {
input.setAttribute('onkeydown', 'event.stopPropagation()');
});
Expand All @@ -477,7 +479,6 @@ function removeKeydownSideEffects() {
function main() {
fetchVersion();
initializeHotkeys();
removeKeydownSideEffects();
goToUploadScreen();
}

Expand Down

0 comments on commit a706380

Please sign in to comment.