mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
parent
c0f7e9d50d
commit
3297296d59
1 changed files with 11 additions and 0 deletions
|
@ -4,6 +4,8 @@ export class Positioned {
|
|||
this.anchorTop(anchor)
|
||||
} else if (anchor && position === 'bottom') {
|
||||
this.anchorBottom(anchor)
|
||||
} else {
|
||||
this.anchorAbsolute()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,6 +33,15 @@ export class Positioned {
|
|||
})
|
||||
}
|
||||
|
||||
anchorAbsolute() {
|
||||
const left =
|
||||
this.parent.offsetLeft +
|
||||
this.parent.clientWidth / 2 -
|
||||
this.container.clientWidth / 2
|
||||
const top = this.parent.offsetTop + 75
|
||||
this.setPosition({ top: top, left: left })
|
||||
}
|
||||
|
||||
getPosition(el) {
|
||||
return el.getBoundingClientRect()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue