Minor code cleaning [2]

This commit is contained in:
euvl
2017-10-09 14:41:44 +01:00
parent 4652eb0b86
commit 553d55d392

View File

@@ -439,6 +439,7 @@
const stop = () => { const stop = () => {
stopEventExecution = true stopEventExecution = true
} }
const beforeEvent = this.genEventObject({ stop, state, params }) const beforeEvent = this.genEventObject({ stop, state, params })
this.$emit(beforeEventName, beforeEvent) this.$emit(beforeEventName, beforeEvent)
@@ -548,10 +549,11 @@
*/ */
callAfterEvent (state) { callAfterEvent (state) {
if (state) { if (state) {
this.observe() this.connectObserver()
} else { } else {
this.disconnectObserver() this.disconnectObserver()
} }
const afterEventName = state const afterEventName = state
? 'opened' ? 'opened'
: 'closed' : 'closed'
@@ -578,9 +580,9 @@
/** /**
* Start observing modal's DOM, if childList or subtree changes, * Start observing modal's DOM, if childList or subtree changes,
* the callback (registered in created) will be called. * the callback (registered in beforeMount) will be called.
*/ */
observe () { connectObserver () {
if (this.mutationObserver) { if (this.mutationObserver) {
this.mutationObserver.observe(this.$refs.modal, { this.mutationObserver.observe(this.$refs.modal, {
childList: true, childList: true,