mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-15 11:09:01 +08:00
refactoring
This commit is contained in:
parent
b8c2238a0a
commit
0cc18dfca2
@ -26,6 +26,7 @@ export default {
|
||||
if (editor) {
|
||||
this.$nextTick(() => {
|
||||
editor.registerPlugin(FloatingMenu({
|
||||
editor,
|
||||
element: this.$el,
|
||||
onUpdate: menu => {
|
||||
this.menu = menu
|
||||
|
@ -30,6 +30,7 @@ export default {
|
||||
if (editor) {
|
||||
this.$nextTick(() => {
|
||||
editor.registerPlugin(MenuBubble({
|
||||
editor,
|
||||
element: this.$el,
|
||||
keepInBounds: this.keepInBounds,
|
||||
onUpdate: menu => {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user