From 8ca6015ddeba00b51d8a647ec21ccddfb04f7cd2 Mon Sep 17 00:00:00 2001 From: Commander-lol <ljcapitanio@gmail.com> Date: Mon, 12 Jan 2015 18:31:35 +0000 Subject: [PATCH] Added "return this" to mu object trigger function --- js/tinyDOM.js | 1 + js/tinyDOM.min.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/js/tinyDOM.js b/js/tinyDOM.js index 53f4c09..70f1bde 100644 --- a/js/tinyDOM.js +++ b/js/tinyDOM.js @@ -131,6 +131,7 @@ this.each(function (i, e) { e.dispatchEvent(event); }); + return this; } }; diff --git a/js/tinyDOM.min.js b/js/tinyDOM.min.js index 3b6df2d..ed4244e 100644 --- a/js/tinyDOM.min.js +++ b/js/tinyDOM.min.js @@ -1 +1 @@ -!function(){"use strict";var a,b,c;Element&&!Element.prototype.matches&&(a=Element.prototype,a.matches=a.matchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.webkitMatchesSelector),b=function(a){if(null===a||"undefined"==typeof a)this.length=0;else if("string"==typeof a){var c,d,b=document.querySelectorAll(a);for(this.length=b.length,c=0;c<b.length;c+=1)d=b.item(c),"undefined"==typeof d.td_prop&&(d.td_prop={isHidden:!1}),this[c]=b.item(c)}else this[0]=a,this.length=1;return this},c=function(a){return new b(a)},c.fn=b.prototype={each:function(a){for(var b=this.length;b--;)a(b,this[b],this);return this},hide:function(){return this.each(function(a,b){b.td_prop.isHidden||(b.style.td_previousDisplay=b.style.display,b.style.display="none",b.td_prop.isHidden=!0)}),this},show:function(){return this.each(function(a,b){b.td_prop.isHidden===!0&&(b.style.display="undefined"!=typeof b.style.td_previousDisplay?b.style.td_previousDisplay:"block",b.td_prop.isHidden=!1)}),this},on:function(a,b,c){return"string"==typeof b?this.each(function(d,e){e.addEventListener(a,function(a){var d=a.target,f=!1;do d&&d.matches(b)?(c.call(d,a),f=!0):(d=d.parentNode,d&&d.matches&&d!==e||(f=!0));while(f!==!0)})}):(c=b,this.each(function(b,d){d.addEventListener(a,c)})),this},first:function(){return"undefined"!=typeof this[0]?this[0]:null},data:function(a,b){var c=this[0];return"undefined"!=typeof b?(c.setAttribute("data-"+a,b),this):c.getAttribute("data-"+a)},trigger:function(a,b,d,e){d=c.exists(d)?d:!0,e=c.exists(e)?e:!0;var f=new CustomEvent(a,b,d,e);this.each(function(a,b){b.dispatchEvent(f)})}},c.exists=function(a){return null!==a&&"undefined"!=typeof a},c.merge=function(a,b){if(this.exists(a)&&this.exists(b)){var c;for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}return null},c.byID=function(a){return c(document.getElementById(a))},c.triggerOn=function(a,b,d,e,f){e=c.exists(e)?e:!0,f=c.exists(f)?f:!0,a.dispatchEvent(new CustomEvent(b,d,e,f))},c.ajax=function(a){var d,e,b=new XMLHttpRequest,f={method:"GET",url:"",async:!0,user:null,password:null,responseType:"text",data:null,headers:[],callbacks:{}},g=function(a){return function(b){a(b.currentTarget.response,b)}};if(this.merge(f,a),b.responseType=f.responseType,this.exists(f.callbacks))for(d in f.callbacks)f.callbacks.hasOwnProperty(d)&&b.addEventListener(d,g(f.callbacks[d]));for(b.open(f.method,f.url,f.async,f.user,f.password),e=0;e<f.headers.length;e++)b.setRequestHeader(f.headers[e].header,f.headers[e].value);return b.send(f.data),b},window.μ||(window.μ=c),window.mu||(window.mu=c)}(); +!function(){"use strict";var a,b,c;Element&&!Element.prototype.matches&&(a=Element.prototype,a.matches=a.matchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.webkitMatchesSelector),b=function(a){if(null===a||"undefined"==typeof a)this.length=0;else if("string"==typeof a){var c,d,b=document.querySelectorAll(a);for(this.length=b.length,c=0;c<b.length;c+=1)d=b.item(c),"undefined"==typeof d.td_prop&&(d.td_prop={isHidden:!1}),this[c]=b.item(c)}else this[0]=a,this.length=1;return this},c=function(a){return new b(a)},c.fn=b.prototype={each:function(a){for(var b=this.length;b--;)a(b,this[b],this);return this},hide:function(){return this.each(function(a,b){b.td_prop.isHidden||(b.style.td_previousDisplay=b.style.display,b.style.display="none",b.td_prop.isHidden=!0)}),this},show:function(){return this.each(function(a,b){b.td_prop.isHidden===!0&&(b.style.display="undefined"!=typeof b.style.td_previousDisplay?b.style.td_previousDisplay:"block",b.td_prop.isHidden=!1)}),this},on:function(a,b,c){return"string"==typeof b?this.each(function(d,e){e.addEventListener(a,function(a){var d=a.target,f=!1;do d&&d.matches(b)?(c.call(d,a),f=!0):(d=d.parentNode,d&&d.matches&&d!==e||(f=!0));while(f!==!0)})}):(c=b,this.each(function(b,d){d.addEventListener(a,c)})),this},first:function(){return"undefined"!=typeof this[0]?this[0]:null},data:function(a,b){var c=this[0];return"undefined"!=typeof b?(c.setAttribute("data-"+a,b),this):c.getAttribute("data-"+a)},trigger:function(a,b,d,e){d=c.exists(d)?d:!0,e=c.exists(e)?e:!0;var f=new CustomEvent(a,b,d,e);return this.each(function(a,b){b.dispatchEvent(f)}),this}},c.exists=function(a){return null!==a&&"undefined"!=typeof a},c.merge=function(a,b){if(this.exists(a)&&this.exists(b)){var c;for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}return null},c.byID=function(a){return c(document.getElementById(a))},c.triggerOn=function(a,b,d,e,f){e=c.exists(e)?e:!0,f=c.exists(f)?f:!0,a.dispatchEvent(new CustomEvent(b,d,e,f))},c.ajax=function(a){var d,e,b=new XMLHttpRequest,f={method:"GET",url:"",async:!0,user:null,password:null,responseType:"text",data:null,headers:[],callbacks:{}},g=function(a){return function(b){a(b.currentTarget.response,b)}};if(this.merge(f,a),b.responseType=f.responseType,this.exists(f.callbacks))for(d in f.callbacks)f.callbacks.hasOwnProperty(d)&&b.addEventListener(d,g(f.callbacks[d]));for(b.open(f.method,f.url,f.async,f.user,f.password),e=0;e<f.headers.length;e++)b.setRequestHeader(f.headers[e].header,f.headers[e].value);return b.send(f.data),b},window.μ||(window.μ=c),window.mu||(window.mu=c)}(); -- GitLab