From: handa Date: Fri, 5 Mar 2010 00:04:09 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: ALPHA~31 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74c400ab1169385fe2da360723bd0570b6cbcdaf;p=m17n%2Fm17n-lib-js.git *** empty log message *** --- diff --git a/xex.js b/xex.js index 2ebaf54..cfbe53a 100644 --- 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';