In upload, in url field, fetch when 'enter' key (#55)

This commit is contained in:
Erhannis 2021-02-20 14:24:18 -05:00 committed by byte[]
parent 4f040da3fa
commit 21dcd0c9df

View file

@ -108,6 +108,13 @@ function setupImageUpload() {
}).catch(showError);
});
// Fetch on "enter" in url field
remoteUrl.addEventListener("keydown", function(event) {
if (event.keyCode === 13) { // Hit enter
fetchButton.click();
}
});
// Enable/disable the fetch button based on content in the image scraper. Fetching with no URL makes no sense.
remoteUrl.addEventListener('input', () => {
if (remoteUrl.value.length > 0) {