Fix JS errors

This commit is contained in:
Guillaume Gomez 2017-12-07 22:55:14 +01:00
parent 71b70feb1f
commit 423e5ac6f3

View File

@ -107,7 +107,10 @@
}
function showSidebar() {
document.getElementsByClassName("sidebar-elems")[0].style.display = "block";
var elems = document.getElementsByClassName("sidebar-elems")[0];
if (elems) {
elems.style.display = "block";
}
var sidebar = document.getElementsByClassName('sidebar')[0];
sidebar.style.position = 'fixed';
sidebar.style.width = '100%';
@ -116,7 +119,10 @@
}
function hideSidebar() {
document.getElementsByClassName("sidebar-elems")[0].style.display = "";
var elems = document.getElementsByClassName("sidebar-elems")[0];
if (elems) {
elems.style.display = "";
}
var sidebar = document.getElementsByClassName('sidebar')[0];
sidebar.style.position = '';
sidebar.style.width = '';