refactoring

This commit is contained in:
Philipp Kühn 2019-06-08 22:38:26 +02:00
parent b8c2238a0a
commit 0cc18dfca2
4 changed files with 4 additions and 10 deletions

View File

@ -26,6 +26,7 @@ export default {
if (editor) {
this.$nextTick(() => {
editor.registerPlugin(FloatingMenu({
editor,
element: this.$el,
onUpdate: menu => {
this.menu = menu

View File

@ -30,6 +30,7 @@ export default {
if (editor) {
this.$nextTick(() => {
editor.registerPlugin(MenuBubble({
editor,
element: this.$el,
keepInBounds: this.keepInBounds,
onUpdate: menu => {

View File

@ -14,7 +14,7 @@ class Menu {
this.isActive = false
this.top = 0
this.editorView.dom.addEventListener('blur', this.hide.bind(this))
this.options.editor.on('blur', this.hide.bind(this))
}
update(view, lastState) {
@ -67,10 +67,6 @@ class Menu {
this.sendUpdate()
}
destroy() {
this.editorView.dom.removeEventListener('blur', this.hide)
}
}
export default function (options) {

View File

@ -67,7 +67,7 @@ class Menu {
this.left = 0
this.bottom = 0
this.editorView.dom.addEventListener('blur', this.hide.bind(this))
this.options.editor.on('blur', this.hide.bind(this))
}
update(view, lastState) {
@ -127,10 +127,6 @@ class Menu {
this.sendUpdate()
}
destroy() {
this.editorView.dom.removeEventListener('blur', this.hide)
}
}
export default function (options) {