Fixed a problem that caused tabs to reload pages

This commit is contained in:
2017-12-04 12:21:41 +01:00
parent 26ab168dd7
commit e8a8e5fb5a
3 changed files with 11 additions and 7 deletions

View File

@ -154,21 +154,21 @@ export class Application {
for(let i = 0; i < links.length; i++) {
let link = links[i] as HTMLElement
// link.classList.remove(this.ajaxClass)
let self = this
link.onclick = function(e) {
// Middle mouse button should have standard behaviour
if(e.which === 2)
if(e.which === 2) {
return
}
let url = this.getAttribute("href")
e.preventDefault()
if(!url || url === self.currentPath)
if(!url || url === self.currentPath) {
return
}
// Load requested page
self.load(url)