Fixed blogposts not opening

This commit is contained in:
Sofia 2016-11-04 12:37:01 +02:00
parent 074020ced7
commit 54dfe2a8cc
2 changed files with 11 additions and 4 deletions

View File

@ -28,12 +28,15 @@ function openPage(page, new_url, renew_history) {
return;
}
slideOpacity(function () {
document.getElementById(window.currPage + "-link").children[0].className = "";
var link = document.getElementById(window.currPage + "-link");
if (link) {
link.children[0].className = "";
link.children[0].className = "active";
}
document.getElementById(window.currPage).className = "hiddenarea";
window.currPage = page;
document.getElementById(page).style.opacity = "0";
document.getElementById(page).className = "";
document.getElementById(page + "-link").children[0].className = "active";
var target = new_url || page;
var targetPg = "/" + target;
if (target == "about") {

View File

@ -41,12 +41,16 @@ function openPage(page: string, new_url: string = null, renew_history=true) {
if (page == window.currPage) { return; }
slideOpacity(() => {
document.getElementById(window.currPage + "-link").children[0].className = ""
let link = document.getElementById(window.currPage + "-link");
if (link) {
link.children[0].className = ""
link.children[0].className = "active"
}
document.getElementById(window.currPage).className = "hiddenarea";
window.currPage = page;
document.getElementById(page).style.opacity = "0";
document.getElementById(page).className = "";
document.getElementById(page + "-link").children[0].className = "active"
let target = new_url || page;
let targetPg = "/" + target;
if (target == "about") { target = ""; targetPg = ""; };