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

Unified Diff: html/static/js/firstRun.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
« no previous file with comments | « no previous file | html/static/js/ieEventListenerPolyfill.js » ('j') | html/static/js/ieFirstRun.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: html/static/js/firstRun.js
===================================================================
--- a/html/static/js/firstRun.js
+++ b/html/static/js/firstRun.js
@@ -20,29 +20,6 @@
var Utils = require("utils").Utils;
var Filter = require("filterClasses").Filter;
-function addListener(object, type, listener)
-{
- // all IE versions require the use of attachEvent for message event to work
- if (type != "message" && "addEventListener" in object)
- object.addEventListener(type, listener, false);
- else
- {
- object.attachEvent("on" + type, function()
- {
- listener(event);
- });
- }
-}
-
-function removeListener(object, type, listener)
-{
- // all IE versions require the use of detachEvent for message event to work
- if (type != "message" && "removeEventListener" in object)
- object.removeEventListener(type, listener);
- else
- object.detachEvent("on" + type, listener);
-}
-
function openSharePopup(url)
{
var iframe = document.getElementById("share-popup");
@@ -146,7 +123,6 @@
function init()
{
- initWrappers();
// Choose a share text variant randomly
var variant = Math.floor(Math.random() * 2) + 1;
var classList = document.documentElement.className.split(" ");
@@ -160,4 +136,4 @@
donateLink.href = getDocLink("donate") + "&variant=" + variant;
}
-addListener(window, "load", init);
+window.addEventListener("load", init);
« no previous file with comments | « no previous file | html/static/js/ieEventListenerPolyfill.js » ('j') | html/static/js/ieFirstRun.js » ('J')

Powered by Google App Engine
This is Rietveld