Lazily apply tooltip calculations
This commit is contained in:
parent
d71f046f53
commit
0a83c00c78
@ -245,6 +245,12 @@ export default class AnimeNotifier {
|
||||
let contentRect = this.app.content.getBoundingClientRect()
|
||||
|
||||
for(let element of elements) {
|
||||
element.onmouseenter = () => {
|
||||
if(element.dataset.offsetAssigned) {
|
||||
element.onmouseenter = null
|
||||
return
|
||||
}
|
||||
|
||||
Diff.mutations.queue(() => {
|
||||
let rect = element.getBoundingClientRect()
|
||||
let tipStyle = window.getComputedStyle(element, ":before")
|
||||
@ -271,9 +277,12 @@ export default class AnimeNotifier {
|
||||
tipChild.style.height = rect.height + "px"
|
||||
element.appendChild(tipChild)
|
||||
}
|
||||
|
||||
element.dataset.offsetAssigned = "true"
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dragAndDrop() {
|
||||
for(let element of findAll("inventory-slot")) {
|
||||
|
Loading…
Reference in New Issue
Block a user