*** empty log message ***
authorhanda <handa>
Fri, 5 Mar 2010 00:04:09 +0000 (00:04 +0000)
committerhanda <handa>
Fri, 5 Mar 2010 00:04:09 +0000 (00:04 +0000)
xex.js

diff --git a/xex.js b/xex.js
index 2ebaf54..cfbe53a 100644 (file)
--- a/xex.js
+++ b/xex.js
@@ -3139,8 +3139,15 @@ MIM.keypress = function (event)
     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++)
@@ -3220,6 +3227,7 @@ MIM.keypress = function (event)
            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';
@@ -3247,6 +3255,7 @@ MIM.keypress = function (event)
                  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';
@@ -3272,6 +3281,7 @@ MIM.keypress = function (event)
                    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';