Browse Source

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.
master
Lephe 8 months ago
parent
commit
4f02160ebb
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      app/static/scripts/trigger_menu.js

+ 1
- 1
app/static/scripts/trigger_menu.js 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);

Loading…
Cancel
Save