Lazily apply tooltip calculations

This commit is contained in:
Eduard Urbach 2018-04-19 11:31:01 +02:00
parent d71f046f53
commit 0a83c00c78

View File

@ -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")) {