navbar: fix bad behaviour when the user is authenticated

The News menu would not open when the user is authenticated,
leaving an empty menu area. Instead, the third button (Forum)
would open the News menu, shifthing every menu down a button.

This was caused by a bad selection query when getting the list
of menus; essentially the selection was equivalent to "#menu div".
Authenticated users have a div in the Account menu with their
name, so this div was mistaken for the second menu.

The problem was fixed by using a different selection equivalent
to "#menu > div" to get the list of menus.
This commit is contained in:
Lephe 2019-02-10 10:05:24 +01:00
parent 255fe82032
commit 4f02160ebb
1 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,7 @@ var trigger_menu = function(active) {
var menu = document.getElementById('menu');
var buttons = document.getElementById('light-menu').getElementsByTagName('li');
var menus = document.getElementById('menu').getElementsByTagName('div');
var menus = document.querySelectorAll('#menu > div');
if(active == -1 || buttons[active].classList.contains('opened')) {
hide(menu);