mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-19 09:41:33 +00:00
Updated home.js
Make sure album newly created on the homepage is properly selected
This commit is contained in:
parent
2d1db2bd01
commit
456f63d0d8
2
dist/js/home.js
vendored
2
dist/js/home.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/home.js.map
vendored
2
dist/js/home.js.map
vendored
File diff suppressed because one or more lines are too long
@ -39,6 +39,7 @@ const page = {
|
|||||||
tabs: [],
|
tabs: [],
|
||||||
activeTab: null,
|
activeTab: null,
|
||||||
albumSelect: null,
|
albumSelect: null,
|
||||||
|
albumSelectOnChange: null,
|
||||||
previewTemplate: null,
|
previewTemplate: null,
|
||||||
|
|
||||||
dropzone: null,
|
dropzone: null,
|
||||||
@ -187,12 +188,13 @@ page.prepareUpload = () => {
|
|||||||
document.querySelector('#albumDiv').classList.remove('is-hidden')
|
document.querySelector('#albumDiv').classList.remove('is-hidden')
|
||||||
|
|
||||||
page.albumSelect = document.querySelector('#albumSelect')
|
page.albumSelect = document.querySelector('#albumSelect')
|
||||||
page.albumSelect.addEventListener('change', () => {
|
page.albumSelectOnChange = () => {
|
||||||
page.album = parseInt(page.albumSelect.value)
|
page.album = parseInt(page.albumSelect.value)
|
||||||
// Re-generate ShareX config file
|
// Re-generate ShareX config file
|
||||||
if (typeof page.prepareShareX === 'function')
|
if (typeof page.prepareShareX === 'function')
|
||||||
page.prepareShareX()
|
page.prepareShareX()
|
||||||
})
|
}
|
||||||
|
page.albumSelect.addEventListener('change', page.albumSelectOnChange)
|
||||||
|
|
||||||
// Fetch albums
|
// Fetch albums
|
||||||
page.fetchAlbums()
|
page.fetchAlbums()
|
||||||
@ -673,6 +675,7 @@ page.createAlbum = () => {
|
|||||||
option.value = response.data.id
|
option.value = response.data.id
|
||||||
option.innerHTML = name
|
option.innerHTML = name
|
||||||
option.selected = true
|
option.selected = true
|
||||||
|
page.albumSelectOnChange()
|
||||||
|
|
||||||
swal('Woohoo!', 'Album was created successfully.', 'success')
|
swal('Woohoo!', 'Album was created successfully.', 'success')
|
||||||
}).catch(page.onError)
|
}).catch(page.onError)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"1": "1586199007",
|
"1": "1586281989",
|
||||||
"2": "1581416390",
|
"2": "1581416390",
|
||||||
"3": "1581416390",
|
"3": "1581416390",
|
||||||
"4": "1581416390",
|
"4": "1581416390",
|
||||||
|
Loading…
Reference in New Issue
Block a user