瀏覽代碼

HUE-815 [fb] Upload button does not work in Firefox

Patched uploader.js
Enrico Berti 13 年之前
父節點
當前提交
f0dc0ba2af
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      desktop/core/static/ext/js/fileuploader.js

+ 5 - 2
desktop/core/static/ext/js/fileuploader.js

@@ -1171,7 +1171,10 @@ qq.extend(qq.UploadHandlerXhr.prototype, {
      * Returns id to use with upload, cancel
      **/
     add: function(file){
-        if (!(file instanceof File)){
+        // HUE-815: [fb] Upload button does not work in Firefox 3.6
+        // see https://github.com/valums/ajax-upload/issues/91
+        //if (!(file instanceof File)){
+        if (!(file instanceof File || file.__proto__.constructor.name == 'File' || file instanceof Object) ){
             throw new Error('Passed obj in not a File (in qq.UploadHandlerXhr)');
         }
 
@@ -1268,4 +1271,4 @@ qq.extend(qq.UploadHandlerXhr.prototype, {
             this._xhrs[id] = null;
         }
     }
-});
+});