navbar: fix null check in the javascript

parent 13e7ecff
......@@ -18,7 +18,7 @@ function ubuntuit_navbar_center_active() {
var navs = document.querySelectorAll("nav");
for (var i = 0; i < navs.length; i++) {
var active = navs[i].querySelector(".active");
if (active !== undefined) {
if (active !== null) {
var offset = active.getBoundingClientRect().left;
navs[i].scrollBy(offset - window.innerWidth / 2 + active.offsetWidth / 2, 0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment