W3C home > Mailing lists > Public > public-dap-commits@w3.org > April 2011

2009/dap/system-info battery-status.html,1.1,1.2

From: Anssi Kostiainen via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 06 Apr 2011 15:06:20 +0000
To: public-dap-commits@w3.org
Message-Id: <E1Q7UJI-0001kd-OZ@lionel-hutz.w3.org>
Update of /sources/public/2009/dap/system-info
In directory hutz:/tmp/cvs-serv6715

Modified Files:
	battery-status.html 
Log Message:
Refined the one-shot example

Index: battery-status.html
===================================================================
RCS file: /sources/public/2009/dap/system-info/battery-status.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- battery-status.html	5 Apr 2011 16:19:12 -0000	1.1
+++ battery-status.html	6 Apr 2011 15:06:18 -0000	1.2
@@ -217,16 +217,13 @@
       </p>
       <div class='example'>
         <pre class='sh_javascript'>
-function handler(event) {
+var handler = function (event) {
   console.log(event.level);
+  window.removeEventListener('batterystatus', handler, true);
 }
 
 window.addEventListener('batterystatus', handler, true);
-window.removeEventListener('batterystatus', handler, true);
         </pre>
-        <p class='note'>
-          The event may be dispatched multiple times in the above example.
-        </p>
       </div>
     </section>
     
Received on Wednesday, 6 April 2011 15:06:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 6 April 2011 15:06:22 GMT