mirror of
https://github.com/codex-team/editor.js
synced 2024-06-09 09:22:16 +02:00
fix: adjust for wrapper offset before deciding toolbar orientation
This commit is contained in:
parent
f7d3754421
commit
643205f0b5
|
@ -191,12 +191,12 @@ export default class InlineToolbar extends Module<InlineToolbarNodes> {
|
|||
*/
|
||||
this.nodes.wrapper.classList.toggle(
|
||||
this.CSS.inlineToolbarLeftOriented,
|
||||
realLeftCoord < this.Editor.UI.contentRect.left
|
||||
realLeftCoord < this.Editor.UI.contentRect.left - wrapperOffset.x
|
||||
);
|
||||
|
||||
this.nodes.wrapper.classList.toggle(
|
||||
this.CSS.inlineToolbarRightOriented,
|
||||
realRightCoord > this.Editor.UI.contentRect.right
|
||||
realRightCoord > this.Editor.UI.contentRect.right - wrapperOffset.x
|
||||
);
|
||||
|
||||
this.nodes.wrapper.style.left = Math.floor(newCoords.x) + 'px';
|
||||
|
|
Loading…
Reference in a new issue