]> source.dussan.org Git - nextcloud-server.git/commitdiff
fixing eventsource.js for IE8
authorThomas Mueller <thomas.mueller@tmit.eu>
Thu, 14 Feb 2013 11:17:14 +0000 (12:17 +0100)
committerThomas Mueller <thomas.mueller@tmit.eu>
Thu, 14 Feb 2013 11:20:22 +0000 (12:20 +0100)
core/js/eventsource.js

index f783ade7ae916cd79401a4fa98bd9b4cbe25b45d..ce8c8387c8efef5eab85542807ca2993a0a998a2 100644 (file)
@@ -87,8 +87,10 @@ OC.EventSource.prototype={
        useFallBack:false,
        fallBackCallBack:function(type,data){
                if(type){
-                       for(var i=0;i<this.listeners[type].length;i++){
-                               this.listeners[type][i](data);
+                       if (typeof this.listeners['done'] != 'undefined') {
+                               for(var i=0;i<this.listeners[type].length;i++){
+                                       this.listeners[type][i](data);
+                               }
                        }
                }else{
                        for(var i=0;i<this.typelessListeners.length;i++){
@@ -117,6 +119,8 @@ OC.EventSource.prototype={
                }
        },
        close:function(){
-               this.source.close();
+               if (typeof this.source !='undefined') {
+                       this.source.close();
+               }
        }
 }