Skip to content

Commit

Permalink
fix: floating menu using event bus
Browse files Browse the repository at this point in the history
the floating menu was still using the eventBus attached to the
Vue instance, which was moved to a separate module recently.
See #326

- add method to call the EventBus for usage in the Vue file
  • Loading branch information
TheGreatRefrigerator committed Feb 15, 2023
1 parent 800b5ac commit 0193e60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<v-list>
<template v-for="(item, index) in menuItems">
<v-layout row :key="index" v-if="item.show">
<v-btn class="floating-item" :key="index" flat v-if="item.emitEvent" @click="eventBus.$emit(item.emitEvent)">
<v-btn class="floating-item" :key="index" flat v-if="item.emitEvent" @click="emitEvent(item.emitEvent)">
<v-icon :title="item.title" left color="dark">{{item.icon}}</v-icon>
<template>{{item.title}}</template>
</v-btn>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import constants from '@/resources/constants'
import {EventBus} from '@/common/event-bus'

export default {
props: {
openOnHover: {
Expand Down Expand Up @@ -86,6 +88,9 @@ export default {
context.setReadyStatus()
}
}, 100)
},
emitEvent (event) {
EventBus.$emit(event)
}
},
created() {
Expand Down

0 comments on commit 0193e60

Please sign in to comment.