Skip to content
Snippets Groups Projects
Commit cc689e68 authored by Guillaume Chau's avatar Guillaume Chau
Browse files

fix(Popper): disabled now call init() and dispose() instead of just showing/hidding the popper

parent f64a7206
No related branches found
No related tags found
No related merge requests found
......@@ -138,7 +138,13 @@ export default {
watch: {
open: '$_autoShowHide',
disabled: '$_autoShowHide',
disabled (value) {
if (value) {
this.dispose()
} else {
this.init()
}
},
container (val) {
if (this.isOpen && this.popperInstance) {
......@@ -176,26 +182,10 @@ export default {
created () {
this.popperId = `popper_${Math.random().toString(36).substr(2, 10)}`
this.$_isDisposed = false
this.$_mounted = false
this.$_events = []
this.$_preventOpen = false
},
mounted () {
// Nodes
this.$_targetNode = this.targetNode()
this.$_popperNode = this.popperNode()
swapAttrs(this.$_targetNode, 'title', 'data-original-title')
this.$_detachPopperNode()
this.$_init()
if (this.open) {
this.show()
}
this.init()
},
activated () {
......@@ -230,6 +220,26 @@ export default {
this.$emit('update:open', false)
},
init () {
this.$_isDisposed = false
this.$_mounted = false
this.$_events = []
this.$_preventOpen = false
// Nodes
this.$_targetNode = this.targetNode()
this.$_popperNode = this.popperNode()
swapAttrs(this.$_targetNode, 'title', 'data-original-title')
this.$_detachPopperNode()
this.$_init()
if (this.open) {
this.show()
}
},
dispose () {
this.$_removeFromOpenPoppers()
this.$_isDisposed = true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment