Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this is some vile monkey patching, think of it what you will, I find it useful
- if('undefined' === typeof window.qs) {
- window.qs = document.querySelector.bind(document);
- }
- if('undefined' === typeof window.qsa) {
- window.qsa = document.querySelectorAll.bind(document);
- }
- if('undefined' === typeof Element.prototype.qs) {
- Element.prototype.qs = Element.prototype.querySelector;
- }
- if('undefined' === typeof Element.prototype.qsa) {
- Element.prototype.qsa = Element.prototype.querySelectorAll;
- }
- if('undefined' === typeof Element.prototype.on) {
- Element.prototype.on = Element.prototype.addEventListener;
- }
- if('undefined' === typeof document.on) {
- document.on = document.addEventListener;
- }
Add Comment
Please, Sign In to add comment