mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
In upload, in url field, fetch when 'enter' key (#55)
This commit is contained in:
parent
4f040da3fa
commit
21dcd0c9df
1 changed files with 7 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue