Move to next slot on choosing a photo
This commit is contained in:
parent
b432769d6f
commit
c7e5fb83fc
@ -55,6 +55,17 @@ function main() {
|
|||||||
selectedPhotos[0].click()
|
selectedPhotos[0].click()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function moveToNextSlot() {
|
||||||
|
/** @type HTMLCollectionOf<HTMLImageElement> */
|
||||||
|
const selectedPhotos = selectedPhotosDiv.getElementsByTagName("img")
|
||||||
|
for (const img of selectedPhotos) {
|
||||||
|
if(img.src.endsWith("stock.svg")) {
|
||||||
|
img.click()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function loadAlbums() {
|
function loadAlbums() {
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
@ -115,6 +126,7 @@ function loadPhotos() {
|
|||||||
for(const photo of photoImgs) {
|
for(const photo of photoImgs) {
|
||||||
photo.onclick = () => {
|
photo.onclick = () => {
|
||||||
selectedPhotoImg.src = photo.src
|
selectedPhotoImg.src = photo.src
|
||||||
|
moveToNextSlot()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user