W3C home > Mailing lists > Public > public-html-commits@w3.org > May 2011

html5/markup/js dfn.js,1.11,1.12

From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 06 May 2011 03:48:27 +0000
To: public-html-commits@w3.org
Message-Id: <E1QIC1j-000544-VW@lionel-hutz.w3.org>
Update of /sources/public/html5/markup/js
In directory hutz:/tmp/cvs-serv19235/js

Modified Files:
	dfn.js 
Log Message:
show dfn popups on enter or spacebar keydown


Index: dfn.js
===================================================================
RCS file: /sources/public/html5/markup/js/dfn.js,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- dfn.js	12 Aug 2010 19:55:38 -0000	1.11
+++ dfn.js	6 May 2011 03:48:25 -0000	1.12
@@ -27,13 +27,16 @@
 }
 var dfnPanel;
 document.addEventListener('click', dfnShow, false);
-document.addEventListener("keyup", function(e) {
+document.addEventListener("keydown", function(e) {
   if(!e) e=window.event;
   var key = e.keyCode ? e.keyCode : e.which;
   if ( key == 27 && dfnPanel) {
     dfnPanel.parentNode.removeChild(dfnPanel);
     dfnPanel = null;
   }
+  if (key === 32 || key === 13) {
+    window.dfnShow(e);
+  }
 }, true);
 function dfnShow(event) {
   if (dfnPanel) {
Received on Friday, 6 May 2011 03:48:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 6 May 2011 03:48:30 GMT