+11
-15
lines changedFilter options
+11
-15
lines changed Original file line number Diff line number Diff line change
@@ -588,13 +588,12 @@ export const BModal = /*#__PURE__*/ Vue.extend({
588
588
this.emitEvent(this.buildEvent(EVENT_NAME_HIDDEN))
589
589
})
590
590
},
591
-
// Event emitter
592
-
emitEvent(bvModalEvt) {
593
-
const type = bvModalEvt.type
594
-
// We emit on root first incase a global listener wants to cancel
591
+
emitEvent(bvEvent) {
592
+
const { type } = bvEvent
593
+
// We emit on `$root` first in case a global listener wants to cancel
595
594
// the event first before the instance emits its event
596
-
this.emitOnRoot(getRootEventName(NAME_MODAL, type), bvModalEvt, bvModalEvt.componentId)
597
-
this.$emit(type, bvModalEvt)
595
+
this.emitOnRoot(getRootEventName(NAME_MODAL, type), bvEvent, bvEvent.componentId)
596
+
this.$emit(type, bvEvent)
598
597
},
599
598
// UI event handlers
600
599
onDialogMousedown() {
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@ import { toInteger } from '../../../utils/number'
63
63
import { keys } from '../../../utils/object'
64
64
import { warn } from '../../../utils/warn'
65
65
import { BvEvent } from '../../../utils/bv-event.class'
66
+
import { listenOnRootMixin } from '../../../mixins/listen-on-root'
66
67
import { BVTooltipTemplate } from './bv-tooltip-template'
67
68
68
69
// --- Constants ---
@@ -138,6 +139,7 @@ const templateData = {
138
139
// @vue/component
139
140
export const BVTooltip = /*#__PURE__*/ Vue.extend({
140
141
name: NAME_TOOLTIP_HELPER,
142
+
mixins: [listenOnRootMixin],
141
143
data() {
142
144
return {
143
145
// BTooltip/BPopover/VBTooltip/VBPopover will update this data
@@ -681,14 +683,9 @@ export const BVTooltip = /*#__PURE__*/ Vue.extend({
681
683
})
682
684
},
683
685
emitEvent(bvEvent) {
684
-
// Emits a BvEvent on $root and this instance
685
-
const eventName = bvEvent.type
686
-
const $root = this.$root
687
-
if ($root && $root.$emit) {
688
-
// Emit an event on $root
689
-
$root.$emit(getRootEventName(this.templateType, eventName), bvEvent)
690
-
}
691
-
this.$emit(eventName, bvEvent)
686
+
const { type } = bvEvent
687
+
this.emitOnRoot(getRootEventName(this.templateType, type), bvEvent)
688
+
this.$emit(type, bvEvent)
692
689
},
693
690
// --- Event handler setup methods ---
694
691
listen() {
Original file line number Diff line number Diff line change
@@ -184,8 +184,8 @@ export const dropdownMixin = Vue.extend({
184
184
// Event emitter
185
185
emitEvent(bvEvent) {
186
186
const { type } = bvEvent
187
+
this.emitOnRoot(getRootEventName(NAME_DROPDOWN, type), bvEvent)
187
188
this.$emit(type, bvEvent)
188
-
this.emitOnRoot(getRootEventName(NAME_DROPDOWN, type))
189
189
},
190
190
showMenu() {
191
191
if (this.disabled) {
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4