roojs-core.js
[roojs1] / Roo / bootstrap / ButtonUploader.js
index 31fdeb6..cd62d87 100644 (file)
@@ -56,25 +56,16 @@ Roo.extend(Roo.bootstrap.ButtonUploader, Roo.bootstrap.Button,  {
     fileCollection : false,
     allowBlank : true,
     
+    multiple : true,
+    
     getAutoCreate : function()
     {
-        var im = {
-            tag: 'input',
-            
-            type : 'file',
-            cls : 'd-none  roo-card-upload-selector' 
-          
-        }
-        if (this.multiple) {
-            im.multiple = 'multiple';
-        }
+       
         
         return  {
             cls :'div' ,
             cn : [
-                Roo.bootstrap.Button.prototype.getAutoCreate.call(this),
-                im
-
+                Roo.bootstrap.Button.prototype.getAutoCreate.call(this) 
             ]
         };
            
@@ -95,10 +86,18 @@ Roo.extend(Roo.bootstrap.ButtonUploader, Roo.bootstrap.Button,  {
                                 (window.URL && URL.revokeObjectURL && URL) || 
                                 (window.webkitURL && webkitURL);
                         
-         
-         
-         
-        this.selectorEl = this.el.select('.roo-card-upload-selector', true).first();
+        var im = {
+            tag: 'input',
+            type : 'file',
+            cls : 'd-none  roo-card-upload-selector' 
+          
+        };
+        if (this.multiple) {
+            im.multiple = 'multiple';
+        }
+        this.selectorEl = Roo.get(document.body).createChild(im); // so it does not capture click event for navitem.
+       
+        //this.selectorEl = this.el.select('.roo-card-upload-selector', true).first();
         
         this.selectorEl.on('change', this.onFileSelected, this);
          
@@ -127,7 +126,7 @@ Roo.extend(Roo.bootstrap.ButtonUploader, Roo.bootstrap.Button,  {
             return;
         }
         var files = Array.prototype.slice.call(this.selectorEl.dom.files);
-        this.selectorEl.dom.reset();
+        this.selectorEl.dom.value  = '';// hopefully reset..
         
         this.fireEvent('uploaded', this,  files );