General improvements
This commit is contained in:
@ -43,6 +43,14 @@ export class AnimeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
onPopState(e: PopStateEvent) {
|
||||
if(e.state) {
|
||||
this.app.load(e.state, false)
|
||||
} else if(this.app.currentPath !== this.app.originalPath) {
|
||||
this.app.load(this.app.originalPath, false)
|
||||
}
|
||||
}
|
||||
|
||||
updateAvatars() {
|
||||
for(let element of findAll(".user-image")) {
|
||||
let img = element as HTMLImageElement
|
||||
@ -60,4 +68,14 @@ export class AnimeNotifier {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// onResize(e: UIEvent) {
|
||||
// let hasScrollbar = this.app.content.clientHeight === this.app.content.scrollHeight
|
||||
|
||||
// if(hasScrollbar) {
|
||||
// this.app.content.classList.add("has-scrollbar")
|
||||
// } else {
|
||||
// this.app.content.classList.remove("has-scrollbar")
|
||||
// }
|
||||
// }
|
||||
}
|
@ -55,7 +55,7 @@ export class Application {
|
||||
this.currentPath = url
|
||||
|
||||
// Start sending a network request
|
||||
let request = this.get("/_" + url)
|
||||
let request = this.get("/_" + url).catch(error => error)
|
||||
|
||||
let onTransitionEnd = e => {
|
||||
// Ignore transitions of child elements.
|
||||
|
@ -7,9 +7,5 @@ let arn = new AnimeNotifier(app)
|
||||
document.addEventListener("DOMContentLoaded", arn.onContentLoaded.bind(arn))
|
||||
document.addEventListener("readystatechange", arn.onReadyStateChange.bind(arn))
|
||||
|
||||
window.onpopstate = e => {
|
||||
if(e.state)
|
||||
app.load(e.state, false)
|
||||
else if(app.currentPath !== app.originalPath)
|
||||
app.load(app.originalPath, false)
|
||||
}
|
||||
window.addEventListener("popstate", arn.onPopState.bind(arn))
|
||||
// window.addEventListener("resize", arn.onResize.bind(arn))
|
Reference in New Issue
Block a user