mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-19 06:43:02 +08:00
Merge pull request #459 from rmckayfleming/master
MenuBubbles below the selection
This commit is contained in:
commit
68ff32a024
@ -66,6 +66,7 @@ class Menu {
|
|||||||
this.isActive = false
|
this.isActive = false
|
||||||
this.left = 0
|
this.left = 0
|
||||||
this.bottom = 0
|
this.bottom = 0
|
||||||
|
this.top = 0
|
||||||
|
|
||||||
// the mousedown event is fired before blur so we can prevent it
|
// the mousedown event is fired before blur so we can prevent it
|
||||||
this.options.element.addEventListener('mousedown', this.handleClick)
|
this.options.element.addEventListener('mousedown', this.handleClick)
|
||||||
@ -129,6 +130,7 @@ class Menu {
|
|||||||
this.left = Math.round(this.options.keepInBounds
|
this.left = Math.round(this.options.keepInBounds
|
||||||
? Math.min(box.width - (el.width / 2), Math.max(left, el.width / 2)) : left)
|
? Math.min(box.width - (el.width / 2), Math.max(left, el.width / 2)) : left)
|
||||||
this.bottom = Math.round(box.bottom - start.top)
|
this.bottom = Math.round(box.bottom - start.top)
|
||||||
|
this.top = Math.round(end.bottom - box.top)
|
||||||
this.isActive = true
|
this.isActive = true
|
||||||
|
|
||||||
this.sendUpdate()
|
this.sendUpdate()
|
||||||
@ -139,6 +141,7 @@ class Menu {
|
|||||||
isActive: this.isActive,
|
isActive: this.isActive,
|
||||||
left: this.left,
|
left: this.left,
|
||||||
bottom: this.bottom,
|
bottom: this.bottom,
|
||||||
|
top: this.top,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user