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()
|
let contentRect = this.app.content.getBoundingClientRect()
|
||||||
|
|
||||||
for(let element of elements) {
|
for(let element of elements) {
|
||||||
|
element.onmouseenter = () => {
|
||||||
|
if(element.dataset.offsetAssigned) {
|
||||||
|
element.onmouseenter = null
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
Diff.mutations.queue(() => {
|
Diff.mutations.queue(() => {
|
||||||
let rect = element.getBoundingClientRect()
|
let rect = element.getBoundingClientRect()
|
||||||
let tipStyle = window.getComputedStyle(element, ":before")
|
let tipStyle = window.getComputedStyle(element, ":before")
|
||||||
@ -271,9 +277,12 @@ export default class AnimeNotifier {
|
|||||||
tipChild.style.height = rect.height + "px"
|
tipChild.style.height = rect.height + "px"
|
||||||
element.appendChild(tipChild)
|
element.appendChild(tipChild)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
element.dataset.offsetAssigned = "true"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dragAndDrop() {
|
dragAndDrop() {
|
||||||
for(let element of findAll("inventory-slot")) {
|
for(let element of findAll("inventory-slot")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user