Restructure event destroy and request abort code
This commit is contained in:
@@ -218,15 +218,12 @@ export default {
|
||||
created () {
|
||||
this.checkIfMobile()
|
||||
|
||||
this.$root.$on('close-sidebar', () => {
|
||||
this.isExpanded = false
|
||||
this.isPinned = false
|
||||
})
|
||||
this.$root.$on('close-sidebar', this.closeSidebar)
|
||||
window.addEventListener('resize', this.checkIfMobile)
|
||||
},
|
||||
|
||||
beforeDestroy () {
|
||||
this.$root.$off('close-sidebar')
|
||||
this.$root.$off('close-sidebar', this.closeSidebar)
|
||||
window.removeEventListener('resize', this.checkIfMobile)
|
||||
},
|
||||
|
||||
|
||||
@@ -330,7 +330,16 @@ export default {
|
||||
mounted () {
|
||||
this.searchUsers('', () => {})
|
||||
|
||||
this.$root.$on(modalOpenEventName, ({ resource, title, target, allSpecific }) => {
|
||||
this.$root.$on(modalOpenEventName, this.loadModal)
|
||||
},
|
||||
|
||||
beforeDestroy () {
|
||||
this.setDefaultValues()
|
||||
this.destroyEvents()
|
||||
},
|
||||
|
||||
methods: {
|
||||
loadModal ({ resource, title, target, allSpecific }) {
|
||||
this.resource = resource
|
||||
this.title = title
|
||||
this.target = target
|
||||
@@ -364,16 +373,8 @@ export default {
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
beforeDestroy () {
|
||||
this.setDefaultValues()
|
||||
this.destroyEvents()
|
||||
},
|
||||
|
||||
methods: {
|
||||
onHide () {
|
||||
this.clear()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user