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

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

Issue 6196733759455232: Issue 1181 - Change polyfill for IE8 (fix settings page) (Closed)
Patch Set: Fix the firstrun page as well Created Aug. 8, 2014, 1:08 p.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
« no previous file with comments | « html/static/js/firstRun.js ('k') | html/static/js/ieFirstRun.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: html/static/js/ieEventListenerPolyfill.js
===================================================================
--- a/html/static/js/ieEventListenerPolyfill.js
+++ b/html/static/js/ieEventListenerPolyfill.js
@@ -1,15 +1,25 @@
-if (typeof window.addEventListener != "function")
+if (typeof Element.prototype.addEventListener != "function")
{
- window.addEventListener = function(type, handler, capture)
+ Element.prototype.addEventListener = function(type, handler, capture)
{
this.attachEvent("on" + type, handler)
};
}
-if (typeof window.removeEventListener != "function")
+if (typeof Element.prototype.removeEventListener != "function")
{
- window.removeEventListener = function(type, handler)
+ Element.prototype.removeEventListener = function(type, handler)
{
this.detachEvent("on" + type, handler)
};
}
+
+if (Window.addEventListener != "function")
Felix Dahlke 2014/08/08 13:22:33 Either Window.prototype or window, not Window. An
+{
+ Window.prototype.addEventListener = Element.prototype.addEventListener;
+}
+
+if (Window.removeEventListener != "function")
+{
+ Window.prototype.removeEventListener = Element.prototype.removeEventListener;
+}
« no previous file with comments | « html/static/js/firstRun.js ('k') | html/static/js/ieFirstRun.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld