- From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
- Date: Sun, 08 May 2011 10:36:47 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/markup/js In directory hutz:/tmp/cvs-serv19217/js Modified Files: dfn.js Log Message: make popops disappear on tab out Index: dfn.js =================================================================== RCS file: /sources/public/html5/markup/js/dfn.js,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- dfn.js 7 May 2011 10:55:23 -0000 1.13 +++ dfn.js 8 May 2011 10:36:45 -0000 1.14 @@ -28,14 +28,33 @@ var dfnPanel; document.addEventListener('click', window.dfnShow, false); document.addEventListener("keydown", function (e) { + var key, ns, p; if (!e) { e = window.event; } - var key = e.keyCode ? e.keyCode : e.which; + key = e.keyCode ? e.keyCode : e.which; if (key === 27 && dfnPanel) { dfnPanel.parentNode.removeChild(dfnPanel); dfnPanel = null; } + if (key === 9 && dfnPanel && e.target.parentNode.nodeName === "LI") { + ns = e.target.nextSibling; + while (ns && ns.nodeType !== ns.ELEMENT_NODE) { + ns = ns.nextSibling; + } + if (ns === null) { + p = event.target.parentNode; + while (p) { + p = p.nextSibling; + if (p && p.nodeName === "LI") { + break; + } + } + if (!p) { + dfnPanel.style.display = "none"; + } + } + } if (key === 32 || key === 13) { window.dfnShow(e); if (e.target.nodeName === "DFN") {
Received on Sunday, 8 May 2011 10:36:48 UTC