-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdime.min.js
1 lines (1 loc) · 907 Bytes
/
dime.min.js
1
!function(){function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}if("function"==typeof window.CustomEvent)return!1;t.prototype=window.Event.prototype,window.CustomEvent=t}(),function(){window.$=document.querySelectorAll.bind(document),NodeList.prototype.each=function(t){for(var e=this,n=0,o=e.length;n<o;n++)t.call(e[n],n,e[n])},Node.prototype.on=function(t,e){for(var n=t.split(" "),o=0,i=n.length;o<i;o++)this.addEventListener(n[o],function(t){e.call(this,t,t.detail)})},NodeList.prototype.on=function(t,e){this.each(function(n,o){o.on(t,e)})},Node.prototype.trigger=function(t,e){var n=new CustomEvent(t,{detail:e});this.dispatchEvent(n)},NodeList.prototype.trigger=function(t,e){this.each(function(n,o){o.trigger(t,e)})},Node.prototype.find=function(t){return this.querySelectorAll(t)}}();