X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2Fbootstrap%2FCardUploader.js;h=d847473c518009f42c5c9ea63c951fed7c69d439;hb=094743ae16652c91d8e31224ef8bb22d9ac252e1;hp=a16a0623f72c05f21ade2c3edefd1e482e772e8b;hpb=d5f27d8672d9bc8a116e152b3043c1f4cc4872fa;p=roojs1 diff --git a/Roo/bootstrap/CardUploader.js b/Roo/bootstrap/CardUploader.js index a16a0623f7..d847473c51 100644 --- a/Roo/bootstrap/CardUploader.js +++ b/Roo/bootstrap/CardUploader.js @@ -63,7 +63,7 @@ Roo.extend(Roo.bootstrap.CardUploader, Roo.bootstrap.Input, { cls : 'd-none' }, { - cls : 'roo-card-uploader-button-container' + cls : 'roo-card-uploader-button-container w-100 mb-2' }, { cls : 'card-columns roo-card-uploader-container' @@ -73,35 +73,21 @@ Roo.extend(Roo.bootstrap.CardUploader, Roo.bootstrap.Input, { }; - var input = Roo.bootstrap.Input.prototype.getAutoCreate.call(this); - - - btn.cls += ' w-100 mb-2'; - var cfg = { - cls : 'roo-card-uploader-wrap', - cn : [ - btn, - { - tag : 'input', - cls : 'd-none roo-card-upload-selector', - type : 'file', - multiple : 'multiple' - }, - - ] - - } - + return cfg; }, getChildContainer : function() /// what children are added to. + { + return this.containerEl; + }, + + getButtonContainer : function() /// what children are added to. { return this.el; }, - initEvents : function() { @@ -109,9 +95,16 @@ Roo.extend(Roo.bootstrap.CardUploader, Roo.bootstrap.Input, { this.addxtype({ xns: Roo.bootstrap, + xtype : 'Button', - - + container_method : 'getButtonContainer' , + title : 'Upload File / Images', // fix changable? + cls : 'w-100', + listeners : { + 'click' : function(e) { + this.onClick(e); + } + } }) @@ -126,7 +119,7 @@ Roo.extend(Roo.bootstrap.CardUploader, Roo.bootstrap.Input, { this.selectorEl = this.el.select('.roo-card-upload-selector', true).first(); - this.selectorEl.on('change', this.onFileSelected, this); + this.selectorEl.on('change', this.onFileSelected, this); if (this.images) { var t = this; this.images.forEach(function(img) {