mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-19 01:31:34 +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: [],
|
||||
activeTab: null,
|
||||
albumSelect: null,
|
||||
albumSelectOnChange: null,
|
||||
previewTemplate: null,
|
||||
|
||||
dropzone: null,
|
||||
@ -187,12 +188,13 @@ page.prepareUpload = () => {
|
||||
document.querySelector('#albumDiv').classList.remove('is-hidden')
|
||||
|
||||
page.albumSelect = document.querySelector('#albumSelect')
|
||||
page.albumSelect.addEventListener('change', () => {
|
||||
page.albumSelectOnChange = () => {
|
||||
page.album = parseInt(page.albumSelect.value)
|
||||
// Re-generate ShareX config file
|
||||
if (typeof page.prepareShareX === 'function')
|
||||
page.prepareShareX()
|
||||
})
|
||||
}
|
||||
page.albumSelect.addEventListener('change', page.albumSelectOnChange)
|
||||
|
||||
// Fetch albums
|
||||
page.fetchAlbums()
|
||||
@ -673,6 +675,7 @@ page.createAlbum = () => {
|
||||
option.value = response.data.id
|
||||
option.innerHTML = name
|
||||
option.selected = true
|
||||
page.albumSelectOnChange()
|
||||
|
||||
swal('Woohoo!', 'Album was created successfully.', 'success')
|
||||
}).catch(page.onError)
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"1": "1586199007",
|
||||
"1": "1586281989",
|
||||
"2": "1581416390",
|
||||
"3": "1581416390",
|
||||
"4": "1581416390",
|
||||
|
Loading…
Reference in New Issue
Block a user