pasties/pasties-js — pull request #13 by gregersrygg (2013-12-05 19:35:22+00:00)
Title: Rely on polyfill for addEventListener instead of utility.on to handle IE's attachEvent

utility.on is the last method left in utility. I looked at many npm-modules to see if anyone solved this without increasing file size. https://github.com/Ralt/dom-listeners was close, but it had some weird dependencies that wasn't defined in package.json, and also has support for event-delegation that we don't need. We rely on polyfills for new ES5-methods, so I think it's a good solution to use a polyfill for addEventListener to support older IE-versions also. This polyfill also handles the differences in the event callback better: https://gist.github.com/eirikbacker/2864711/dcc32b15ea79f8f364ca1707f81ec74a15fa25db