Code review changes
This commit is contained in:
parent
f8b5e869fd
commit
279f4c84f8
@ -133,14 +133,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async mounted () {
|
async mounted () {
|
||||||
window.addEventListener('keyup', this.key)
|
window.addEventListener('keydown', this.key)
|
||||||
this.$store.commit('setPreviewMode', true)
|
this.$store.commit('setPreviewMode', true)
|
||||||
this.listing = this.oldReq.items
|
this.listing = this.oldReq.items
|
||||||
this.$root.$on('preview_deleted', this.deleted)
|
this.$root.$on('preview-deleted', this.deleted)
|
||||||
this.updatePreview()
|
this.updatePreview()
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
window.removeEventListener('keyup', this.key)
|
window.removeEventListener('keydown', this.key)
|
||||||
this.$store.commit('setPreviewMode', false)
|
this.$store.commit('setPreviewMode', false)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -153,8 +153,10 @@ export default {
|
|||||||
|
|
||||||
if (this.hasNext) {
|
if (this.hasNext) {
|
||||||
this.next()
|
this.next()
|
||||||
} else {
|
} else if (!this.hasPrevious && !this.hasNext == true) {
|
||||||
this.back()
|
this.back()
|
||||||
|
} else {
|
||||||
|
this.prev()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
back () {
|
back () {
|
||||||
@ -169,7 +171,6 @@ export default {
|
|||||||
this.$router.push({ path: this.nextLink })
|
this.$router.push({ path: this.nextLink })
|
||||||
},
|
},
|
||||||
key (event) {
|
key (event) {
|
||||||
event.preventDefault()
|
|
||||||
|
|
||||||
if (this.show !== null) {
|
if (this.show !== null) {
|
||||||
return
|
return
|
||||||
|
|||||||
@ -31,7 +31,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['closeHovers']),
|
...mapMutations(['closeHovers']),
|
||||||
submit: async function () {
|
submit: async function () {
|
||||||
this.closeHovers()
|
|
||||||
buttons.loading('delete')
|
buttons.loading('delete')
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -39,10 +38,13 @@ export default {
|
|||||||
await api.remove(this.$route.path)
|
await api.remove(this.$route.path)
|
||||||
buttons.success('delete')
|
buttons.success('delete')
|
||||||
|
|
||||||
this.$root.$emit('preview_deleted', this.$route.path)
|
this.$root.$emit('preview-deleted', this.$route.path)
|
||||||
|
this.closeHovers()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.closeHovers()
|
||||||
|
|
||||||
if (this.selectedCount === 0) {
|
if (this.selectedCount === 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user