Add/emit show/hide events in EditorFloatingMenu component

This commit is contained in:
Salem Nzeukwu
2019-08-31 00:26:41 +01:00
parent 2f5c50297b
commit a9db2b2a51

View File

@@ -29,6 +29,12 @@ export default {
editor,
element: this.$el,
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
},
}))