refactoring
This commit is contained in:
@@ -26,6 +26,7 @@ export default {
|
|||||||
if (editor) {
|
if (editor) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
editor.registerPlugin(FloatingMenu({
|
editor.registerPlugin(FloatingMenu({
|
||||||
|
editor,
|
||||||
element: this.$el,
|
element: this.$el,
|
||||||
onUpdate: menu => {
|
onUpdate: menu => {
|
||||||
this.menu = menu
|
this.menu = menu
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export default {
|
|||||||
if (editor) {
|
if (editor) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
editor.registerPlugin(MenuBubble({
|
editor.registerPlugin(MenuBubble({
|
||||||
|
editor,
|
||||||
element: this.$el,
|
element: this.$el,
|
||||||
keepInBounds: this.keepInBounds,
|
keepInBounds: this.keepInBounds,
|
||||||
onUpdate: menu => {
|
onUpdate: menu => {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class Menu {
|
|||||||
this.isActive = false
|
this.isActive = false
|
||||||
this.top = 0
|
this.top = 0
|
||||||
|
|
||||||
this.editorView.dom.addEventListener('blur', this.hide.bind(this))
|
this.options.editor.on('blur', this.hide.bind(this))
|
||||||
}
|
}
|
||||||
|
|
||||||
update(view, lastState) {
|
update(view, lastState) {
|
||||||
@@ -67,10 +67,6 @@ class Menu {
|
|||||||
this.sendUpdate()
|
this.sendUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
|
||||||
this.editorView.dom.removeEventListener('blur', this.hide)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function (options) {
|
export default function (options) {
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class Menu {
|
|||||||
this.left = 0
|
this.left = 0
|
||||||
this.bottom = 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) {
|
update(view, lastState) {
|
||||||
@@ -127,10 +127,6 @@ class Menu {
|
|||||||
this.sendUpdate()
|
this.sendUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
|
||||||
this.editorView.dom.removeEventListener('blur', this.hide)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function (options) {
|
export default function (options) {
|
||||||
|
|||||||
Reference in New Issue
Block a user