From 24a979bbfc7c76d22b5c48b0367c07801d7648e2 Mon Sep 17 00:00:00 2001
From: Commander-lol <ljcapitanio@gmail.com>
Date: Sat, 1 Nov 2014 19:12:52 +0000
Subject: [PATCH] Quick fix to tinyDOM.ajax()

tinyDOM.ajax() now returns the XMLHttpRequest, as it should have to
begin with
---
 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 623809c..e629bef 100644
--- a/js/tinyDOM.js
+++ b/js/tinyDOM.js
@@ -142,6 +142,7 @@
 		}
 
 		req.send(params.data);
+		return req;
 	};
 
 	if(!window.μ){
diff --git a/js/tinyDOM.min.js b/js/tinyDOM.min.js
index 91378e9..db8cd0e 100644
--- a/js/tinyDOM.min.js
+++ b/js/tinyDOM.min.js
@@ -1 +1 @@
-!function(){var a=function(a){return new b(a)},b=function(a){var b=document.querySelectorAll(a);this.length=b.length;for(var c=0;c<b.length;c++){var d=b.item(c);"undefined"==typeof d.td_prop&&(d.td_prop={isHidden:!1}),this[c]=b.item(c)}return this};a.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){return this.each(function(c,d){d.addEventListener(a,b)}),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)}},a.exists=function(a){return null!==a&&"undefined"!=typeof a},a.merge=function(a,b){if(this.exists(a)&&this.exists(b)){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}return null},a.ajax=function(a){var b=new XMLHttpRequest,c=this,d={method:"GET",url:"",async:!0,user:null,password:null,responseType:"text",data:null,headers:[],success:null,error:null};this.merge(d,a),b.responseType=d.responseType,b.onreadystatechange=function(){b.readyState>1&&(200===b.status?4===b.readyState&&c.exists(d.success)&&d.success(b.response,b):(b.abort(),c.exists(d.error)&&d.error({status:b.status,message:b.statusText},b)))},b.open(d.method,d.url,d.async,d.user,d.password);for(var e=0;e<d.headers.length;e++)b.setRequestHeader(d.headers[e].header,d.headers[e].value);b.send(d.data)},window.μ||(window.μ=a),window.mu||(window.mu=a)}();
+!function(){var a=function(a){return new b(a)},b=function(a){var b=document.querySelectorAll(a);this.length=b.length;for(var c=0;c<b.length;c++){var d=b.item(c);"undefined"==typeof d.td_prop&&(d.td_prop={isHidden:!1}),this[c]=b.item(c)}return this};a.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){return this.each(function(c,d){d.addEventListener(a,b)}),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)}},a.exists=function(a){return null!==a&&"undefined"!=typeof a},a.merge=function(a,b){if(this.exists(a)&&this.exists(b)){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}return null},a.ajax=function(a){var b=new XMLHttpRequest,c=this,d={method:"GET",url:"",async:!0,user:null,password:null,responseType:"text",data:null,headers:[],success:null,error:null};this.merge(d,a),b.responseType=d.responseType,b.onreadystatechange=function(){b.readyState>1&&(200===b.status?4===b.readyState&&c.exists(d.success)&&d.success(b.response,b):(b.abort(),c.exists(d.error)&&d.error({status:b.status,message:b.statusText},b)))},b.open(d.method,d.url,d.async,d.user,d.password);for(var e=0;e<d.headers.length;e++)b.setRequestHeader(d.headers[e].header,d.headers[e].value);return b.send(d.data),b},window.μ||(window.μ=a),window.mu||(window.mu=a)}();
-- 
GitLab