Roo.bootstrap.CardUploader.superclass.constructor.call(this, config);
- this.imageCollection = new Roo.util.MixedCollection(function(r) { return r.id });
+ this.imageCollection = new Roo.util.MixedCollection(function(r) { return r.data.id });
};
is_uploaded : false,
src : url,
title : file.name,
- mimetype : file.mimetype,
+ mimetype : file.type,
+ preview : false,
})
},
// hidden input element?
// if the file is not an image...
//then we need to use something other that and header_image
-
+ var t = this;
// remove.....
var footer = [
{
fa : 'download',
listeners : {
click : function() {
- // download
+ this.downloadCard(data.id)
}
}
},
size : 'sm',
weight: 'danger',
cls : 'col-1',
- fa : 'times'
+ fa : 'times',
+ listeners : {
+ click : function() {
+ this.removeCard(data.id)
+ }
+ }
}
]
}
xns : Roo.bootstrap,
xtype : 'Card',
closeable : true,
- header : !data.mimetype.match('/image/') ? "Document": false,
- header_image : data.mimetype.match('/image/') ? data.src : false,
+ header : !data.mimetype.match(/image/) && !data.preview ? "Document": false,
+ header_image : data.mimetype.match(/image/) ? data.src : data.preview,
data : data,
html : false,
listeners : {