Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: html/static/js/ieEventListenerPolyfill.js

Issue 4859491858251776: Fix the approach used in ieFirstRun.js (Closed)
Patch Set: Use polyfill for addEventListener Created July 2, 2014, 8:40 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: html/static/js/ieEventListenerPolyfill.js
===================================================================
new file mode 100644
--- /dev/null
+++ b/html/static/js/ieEventListenerPolyfill.js
@@ -0,0 +1,15 @@
+if (typeof window.addEventListener != "function")
+{
+ window.addEventListener = function(type, handler, capture)
+ {
+ this.attachEvent("on" + type, handler)
+ };
+}
+
+if (typeof window.removeEventListener != "function")
+{
+ window.removeEventListener = function(type, handler)
+ {
+ this.detachEvent("on" + type, handler)
+ };
+}

Powered by Google App Engine
This is Rietveld