var target = event.target;
if (target.menu_level)
{
- if (last_target && last_target.menu_level <= target.menu_level)
+ Xex.Log ("menu show level " + target.menu_level + ': '
+ + target.tagName);
+ if (! last_target || last_target.parentLi == target)
{
+ Xex.Log ('Sub opened');
+ }
+ else
+ {
+ Xex.Log ('Sibling opened');
last_target.style.backgroundColor = 'white';
var uls = last_target.getElementsByTagName ('ul');
for (var i = 0; i < uls.length; i++)
var cat = lang_category[catname];
var li = document.createElement ('li');
li.menu_level = 1;
+ li.parentLi = menu;
li.style.position = 'relative';
li.style.listStyle= 'none';
li.style.margin = '0';
continue;
var sub_li = document.createElement ('li');
sub_li.menu_level = 2;
+ sub_li.parentLi = li;
sub_li.style.position = 'relative';
sub_li.style.padding = '1px';
sub_li.style.borderBottom = '1px solid gray';
var im = lang.list[name];
var subsub_li = document.createElement ('li');
subsub_li.menu_level = 3;
+ subsub_li.parentLi = sub_li;
subsub_li.style.position = 'relative';
subsub_li.style.padding = '1px';
subsub_li.style.borderBottom = '1px solid gray';