X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=docs%2Fsrc%2FRoo_bootstrap_CardUploader.js.html;h=cf56f5a39ab9e9c9c4b12d75e47701039b5b1686;hp=d9db87f6fe7b16e61d714d137f2039db9c7c6458;hb=f23648e68ee576b98060b387acf5f29662400531;hpb=3ad2f9fb7caa21891ba55ae8a209471471541312 diff --git a/docs/src/Roo_bootstrap_CardUploader.js.html b/docs/src/Roo_bootstrap_CardUploader.js.html index d9db87f6fe..cf56f5a39a 100644 --- a/docs/src/Roo_bootstrap_CardUploader.js.html +++ b/docs/src/Roo_bootstrap_CardUploader.js.html @@ -28,7 +28,25 @@ return r.data.id }); - + this.addEvents({ + // raw events + /** + * @event preview + * When a image is clicked on - and needs to display a slideshow or similar.. + * @param {Roo.bootstrap.Card} this + * @param {Object} The image information data + * + */ + 'preview' : true, + /** + * @event download + * When a the download link is clicked + * @param {Roo.bootstrap.Card} this + * @param {Object} The image information data contains + */ + 'download' : true + + }); }; Roo.extend(Roo.bootstrap.CardUploader, Roo.bootstrap.Input, { @@ -199,6 +217,25 @@ }, + /** + * addCard - add an Attachment to the uploader + * @param data - the data about the image to upload + * + * { + id : 123 + title : "Title of file", + is_uploaded : false, + src : "http://.....", + srcfile : { the File upload object }, + mimetype : file.type, + preview : false, + is_deleted : 0 + .. any other data... + } + * + * + */ + addCard : function (data) { // hidden input element? @@ -227,7 +264,8 @@ fa : 'download', listeners : { click : function() { - this.downloadCard(data.id) + + t.fireEvent( "download", t, data ); } } }, @@ -269,9 +307,10 @@ items : footer, initEvents : function() { Roo.bootstrap.Card.prototype.initEvents.call(this); + var card = this; this.imgEl = this.el.select('.card-img-top').first(); if (this.imgEl) { - this.imgEl.on('click', function() { t.previewCard( data.id); }, this); + this.imgEl.on('click', function() { t.fireEvent( "preview", t, data ); }, this); this.imgEl.set({ 'pointer' : 'cursor' }); }