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

Side by Side Diff: html/static/js/ieEventListenerPolyfill.js

Issue 6196733759455232: Issue 1181 - Change polyfill for IE8 (fix settings page) (Closed)
Patch Set: Created Aug. 8, 2014, 11:01 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 if (typeof window.addEventListener != "function") 1 if (typeof Element.prototype.addEventListener != "function")
Felix Dahlke 2014/08/08 12:34:08 I'm not sure why this works in IE8 frankly, window
Oleksandr 2014/08/08 13:11:06 It actually wasn't working on firstrun page, my ba
2 { 2 {
3 window.addEventListener = function(type, handler, capture) 3 Element.prototype.addEventListener = function(type, handler, capture)
4 { 4 {
5 this.attachEvent("on" + type, handler) 5 this.attachEvent("on" + type, handler)
6 }; 6 };
7 } 7 }
8 8
9 if (typeof window.removeEventListener != "function") 9 if (typeof Element.prototype.removeEventListener != "function")
10 { 10 {
11 window.removeEventListener = function(type, handler) 11 Element.prototype.removeEventListener = function(type, handler)
12 { 12 {
13 this.detachEvent("on" + type, handler) 13 this.detachEvent("on" + type, handler)
14 }; 14 };
15 } 15 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld