Improved navigation performance
This commit is contained in:
parent
9d06309dc1
commit
dd10b8e1e4
@ -239,13 +239,12 @@ export default class AnimeNotifier {
|
||||
|
||||
assignTooltipOffsets(elements?: IterableIterator<HTMLElement>) {
|
||||
const distanceToBorder = 5
|
||||
let contentRect: ClientRect
|
||||
|
||||
if(!elements) {
|
||||
elements = findAll("tip")
|
||||
}
|
||||
|
||||
let contentRect = this.app.content.getBoundingClientRect()
|
||||
|
||||
for(let element of elements) {
|
||||
element.onmouseenter = () => {
|
||||
if(element.dataset.offsetAssigned) {
|
||||
@ -254,6 +253,10 @@ export default class AnimeNotifier {
|
||||
}
|
||||
|
||||
Diff.mutations.queue(() => {
|
||||
if(!contentRect) {
|
||||
contentRect = this.app.content.getBoundingClientRect()
|
||||
}
|
||||
|
||||
let rect = element.getBoundingClientRect()
|
||||
let tipStyle = window.getComputedStyle(element, ":before")
|
||||
let tipWidth = parseInt(tipStyle.width) + parseInt(tipStyle.paddingLeft) * 2
|
||||
|
Loading…
Reference in New Issue
Block a user