* @cfg {Number} errorTimeout default 3000
* @cfg {Array} images an array of ?? Img objects ??? when loading existing files..
* @cfg {Array} html The button text.
-
+ * @cfg {Boolean} multiple (default true) Should the upload allow multiple files to be uploaded.
*
* @constructor
* Create a new CardUploader
/**
* @event fired when files have been selected,
* When a the download link is clicked
- * @param {Roo.bootstrap.Card} this
- * @param {Object} The image information data contains
+ * @param {Roo.bootstrap.UploaderButton} this
+ * @param {Array} Array of files that have been uploaded
*/
'uploaded' : true
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),
- {
- tag: 'input',
- multiple : 'multiple',
- type : 'file',
- cls : 'd-none roo-card-upload-selector'
-
- }
-
+ im
]
};
if(typeof(this.selectorEl.dom.files) == 'undefined' || !this.selectorEl.dom.files.length){
return;
}
+ var files = Array.prototype.slice.call(this.selectorEl.dom.files);
+ this.selectorEl.dom.reset();
+
+ this.fireEvent('uploaded', this, files );
- Roo.each(this.selectorEl.dom.files, function(file){
- var url = this.urlAPI.createObjectURL(file); // not sure...
- this.fireEvent('uploaded', this, [file, url]);
- }, this);
-
},