More review changes for #1091
This commit is contained in:
parent
279f4c84f8
commit
12d971bf3c
@ -142,18 +142,15 @@ export default {
|
||||
beforeDestroy () {
|
||||
window.removeEventListener('keydown', this.key)
|
||||
this.$store.commit('setPreviewMode', false)
|
||||
this.$root.$off('preview-deleted', this.deleted)
|
||||
},
|
||||
methods: {
|
||||
deleted (path) {
|
||||
|
||||
let pieces = path.split('/')
|
||||
let deletedName = decodeURIComponent(pieces[pieces.length - 1])
|
||||
|
||||
this.listing = this.listing.filter(item => item.name !== deletedName)
|
||||
deleted () {
|
||||
this.listing = this.listing.filter(item => item.name !== this.name)
|
||||
|
||||
if (this.hasNext) {
|
||||
this.next()
|
||||
} else if (!this.hasPrevious && !this.hasNext == true) {
|
||||
} else if (!this.hasPrevious && !this.hasNext) {
|
||||
this.back()
|
||||
} else {
|
||||
this.prev()
|
||||
|
||||
@ -38,7 +38,7 @@ export default {
|
||||
await api.remove(this.$route.path)
|
||||
buttons.success('delete')
|
||||
|
||||
this.$root.$emit('preview-deleted', this.$route.path)
|
||||
this.$root.$emit('preview-deleted')
|
||||
this.closeHovers()
|
||||
return
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user