Heavily improved page reload

This commit is contained in:
2017-07-19 09:09:55 +02:00
parent 80264f91b8
commit cd6641cc06
3 changed files with 14 additions and 5 deletions

View File

@ -36,6 +36,9 @@ export class AnimeNotifier {
Diff.persistentClasses.add("mounted")
Diff.persistentClasses.add("image-found")
// Never remove src property on diffs
Diff.persistentAttributes.add("src")
if("IntersectionObserver" in window) {
// Enable lazy load
this.visibilityObserver = new IntersectionObserver(
@ -374,10 +377,10 @@ export class AnimeNotifier {
loading(isLoading: boolean) {
if(isLoading) {
document.body.style.cursor = "progress"
document.documentElement.style.cursor = "progress"
this.app.loading.classList.remove(this.app.fadeOutClass)
} else {
document.body.style.cursor = "auto"
document.documentElement.style.cursor = "auto"
this.app.loading.classList.add(this.app.fadeOutClass)
}
}