* Fixed information of selected files being cleared when canceling either add to album or bulk delete prompt.

* Add to album prompt will now show how many files are going to be moved.

* Fixed bulk delete failing to reload file list properly when being used while listing an album.

* Added new ESLint rule "quotes" with option "single". I'm pretty sure Standard used to have this as default. I actually liked that back then.
This commit is contained in:
Bobby Wibowo 2018-03-31 23:34:16 +07:00
parent 4217cf4b0f
commit 8f41cd6f8c
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
3 changed files with 10 additions and 4 deletions

View File

@ -54,6 +54,10 @@
"curly": [
"error",
"all"
],
"quotes": [
"error",
"single"
]
}
},

View File

@ -17,7 +17,7 @@
<script type="text/javascript" src="libs/sweetalert/sweetalert.min.js?v=8FbubjpYRC"></script>
<script type="text/javascript" src="libs/axios/axios.min.js?v=8FbubjpYRC"></script>
<script type="text/javascript" src="libs/clipboard.js/clipboard.min.js?v=8FbubjpYRC"></script>
<script type="text/javascript" src="js/dashboard.js?v=RLPtEH87fK"></script>
<script type="text/javascript" src="js/dashboard.js?v=n5WyWY93dp"></script>
<!-- Open Graph tags -->
<meta property="og:type" content="website" />

View File

@ -377,7 +377,7 @@ panel.deleteFile = (id, album, page) => {
})
}
panel.deleteSelectedFiles = async (ids, album) => {
panel.deleteSelectedFiles = async album => {
const count = panel.selectedFiles.length
if (!count) {
return swal('An error occurred!', 'You have not selected any files.', 'error')
@ -437,7 +437,8 @@ panel.addSelectedFilesToAlbum = async album => {
}
const failedIds = await panel.addToAlbum(panel.selectedFiles, album)
if (failedIds && failedIds.length) {
if (!(failedIds instanceof Array)) { return } // TODO: Make it so that I don't have to do this
if (failedIds.length) {
panel.selectedFiles = panel.selectedFiles.filter(id => failedIds.includes(id))
} else {
panel.selectedFiles = []
@ -446,9 +447,10 @@ panel.addSelectedFilesToAlbum = async album => {
}
panel.addToAlbum = async (ids, album) => {
const count = ids.length
const proceed = await swal({
title: 'Are you sure?',
text: 'You will be able to choose an album after confirming this.',
text: `You are about to move ${count} file${count === 1 ? '' : 's'} to an album.`,
buttons: {
cancel: true,
confirm: {