diff options
author | Robin <robin@Amaya.(none)> | 2010-03-29 21:49:11 +0200 |
---|---|---|
committer | Robin <robin@Amaya.(none)> | 2010-03-29 21:49:11 +0200 |
commit | e658a0025895d5aecc2c067234c5120cc21a63a2 (patch) | |
tree | eb3b7c0f6ec449e3ebb5c73bb511de4e89bb31ff /js/lib_xmlloader.js | |
parent | 5ac201dc834664989b04da9b28fc44bcd84874da (diff) | |
download | nextcloud-server-e658a0025895d5aecc2c067234c5120cc21a63a2.tar.gz nextcloud-server-e658a0025895d5aecc2c067234c5120cc21a63a2.zip |
show file actions in a dropdown menu
Diffstat (limited to 'js/lib_xmlloader.js')
-rw-r--r-- | js/lib_xmlloader.js | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/js/lib_xmlloader.js b/js/lib_xmlloader.js index 14fd3ee8af1..ce6fd824fc1 100644 --- a/js/lib_xmlloader.js +++ b/js/lib_xmlloader.js @@ -49,19 +49,22 @@ OCXMLLoader.prototype={ request=(request)?request:""; method=this.method; contentType=(!this.contentType && method=="POST")?"application/x-www-form-urlencoded":this.contentType; - if(window.XDomainRequest){ - req=new XDomainRequest(); - }else if(window.XMLHttpRequest){ + if(window.XMLHttpRequest){ req=new XMLHttpRequest(); + }else if(window.XDomainRequest){ + req=new XDomainRequest(); }else if(window.ActiveXObject){ req=new ActiveXObject('Microsoft.XMLHTTP') } if (req){ + this.req=req; try{ - var loader=this; - req.onreadystatechange=function(){ - loader.onReadyState.call(loader,req) - } +// var loader=this; +// req.onreadystatechange=function(){ +// loader.onReadyState.call(loader,req) +// } + var callback=new callBack(this.onReadyState,this); + req.onreadystatechange=function(){eval('callBack.call('+callback.id+')');}; req.open(method,url,this.async); if (contentType){ req.setRequestHeader("Content-Type",contentType); @@ -76,15 +79,15 @@ OCXMLLoader.prototype={ } } }, - onReadyState:function(req){ - var ready=req.readyState; + onReadyState:function(){ + var ready=this.req.readyState; if (ready==READY_STATE_COMPLETE){ var HttpStatus=req.status; if (HttpStatus==200 || HttpStatus==0){ //alert("response: "+this.req.responseText); - this.callBack(req); + this.callBack(this.req); }else{ - this.errorCallBack(req); + this.errorCallBack(this.req); } } }, |