Automatically jumps to the next photo when deleting while previewing.
This commit is contained in:
parent
d562d1a60d
commit
c984771de7
@ -147,6 +147,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
back () {
|
back () {
|
||||||
this.$store.commit('setPreviewMode', false)
|
this.$store.commit('setPreviewMode', false)
|
||||||
|
this.$store.commit('postDeleteLink', null)
|
||||||
let uri = url.removeLastDir(this.$route.path) + '/'
|
let uri = url.removeLastDir(this.$route.path) + '/'
|
||||||
this.$router.push({ path: uri })
|
this.$router.push({ path: uri })
|
||||||
},
|
},
|
||||||
@ -205,6 +206,7 @@ export default {
|
|||||||
for (let j = i + 1; j < this.listing.length; j++) {
|
for (let j = i + 1; j < this.listing.length; j++) {
|
||||||
if (mediaTypes.includes(this.listing[j].type)) {
|
if (mediaTypes.includes(this.listing[j].type)) {
|
||||||
this.nextLink = this.listing[j].url
|
this.nextLink = this.listing[j].url
|
||||||
|
this.$store.commit('postDeleteLink', this.nextLink);
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,14 @@ export default {
|
|||||||
if (!this.isListing) {
|
if (!this.isListing) {
|
||||||
await api.remove(this.$route.path)
|
await api.remove(this.$route.path)
|
||||||
buttons.success('delete')
|
buttons.success('delete')
|
||||||
this.$router.push({ path: url.removeLastDir(this.$route.path) + '/' })
|
let path = url.removeLastDir(this.$route.path) + '/'
|
||||||
|
|
||||||
|
if (this.$store.state.postDeleteLink != null) {
|
||||||
|
path = this.$store.state.postDeleteLink;
|
||||||
|
this.$store.commit('postDeleteLink', null);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$router.push({ path: path })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,8 @@ const state = {
|
|||||||
showShell: false,
|
showShell: false,
|
||||||
showMessage: null,
|
showMessage: null,
|
||||||
showConfirm: null,
|
showConfirm: null,
|
||||||
previewMode: false
|
previewMode: false,
|
||||||
|
postDeleteLink: null
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
|
|||||||
@ -86,6 +86,9 @@ const mutations = {
|
|||||||
},
|
},
|
||||||
setPreviewMode(state, value) {
|
setPreviewMode(state, value) {
|
||||||
state.previewMode = value
|
state.previewMode = value
|
||||||
|
},
|
||||||
|
postDeleteLink: (state, value) => {
|
||||||
|
state.postDeleteLink = value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user