adding show and hide events to listen on for menububble

This commit is contained in:
Chrissi2812
2019-02-20 12:14:00 +01:00
parent 3de6b13004
commit 086f540ba0

View File

@@ -28,6 +28,12 @@ export default {
editor.registerPlugin(MenuBubble({ editor.registerPlugin(MenuBubble({
element: this.$el, element: this.$el,
onUpdate: menu => { onUpdate: menu => {
// the second check ensures event is fired only once
if (menu.isActive && this.menu.isActive === false) {
this.$emit('show', menu)
} else if (!menu.isActive && this.menu.isActive === true) {
this.$emit('hide', menu)
}
this.menu = menu this.menu = menu
}, },
})) }))