Created
May 24, 2016 11:16
-
-
Save fael/538ce89ba26fbbe75ca2162a5d4c536c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bling.js | |
var $ = window.$ = document.querySelector.bind(document); | |
var $$ = window.$$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function(name, fn) { | |
this.addEventListener(name, fn); | |
} | |
NodeList.prototype.__proto__ = Array.prototype; | |
NodeList.prototype.on = NodeList.prototype.addEventListener = (function(name, fn) { | |
this.forEach(function(elem) { | |
elem.on(name, fn); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment