From f23648e68ee576b98060b387acf5f29662400531 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 10 Mar 2021 17:34:32 +0800 Subject: [PATCH] Changed docs/json/roodata.jsondocs/src/Roo_bootstrap_CardUploader.js.htmldocs/symbols/Roo.bootstrap.CardUploader.json --- docs/json/roodata.json | 22 +++++++ docs/src/Roo_bootstrap_CardUploader.js.html | 45 ++++++++++++- docs/symbols/Roo.bootstrap.CardUploader.json | 69 ++++++++++++++++++++ 3 files changed, 133 insertions(+), 3 deletions(-) diff --git a/docs/json/roodata.json b/docs/json/roodata.json index b51fc0fbd8..f1a1f561c7 100644 --- a/docs/json/roodata.json +++ b/docs/json/roodata.json @@ -21813,6 +21813,13 @@ "sig" : "function (_self)\n{\n\n}", "memberOf" : "Roo.Component" }, + { + "name" : "download", + "type" : "function", + "desc" : "When a the download link is clicked", + "sig" : "function (_self, The)\n{\n\n}", + "memberOf" : "" + }, { "name" : "enable", "type" : "function", @@ -21827,6 +21834,13 @@ "sig" : "function (_self)\n{\n\n}", "memberOf" : "Roo.Component" }, + { + "name" : "preview", + "type" : "function", + "desc" : "When a image is clicked on - and needs to display a slideshow or similar..", + "sig" : "function (_self, The)\n{\n\n}", + "memberOf" : "" + }, { "name" : "render", "type" : "function", @@ -21850,6 +21864,14 @@ } ], "methods" : [ + { + "name" : "addCard", + "type" : "function", + "desc" : "addCard - add an Attachment to the uploader", + "sig" : "(data)", + "static" : false, + "memberOf" : "" + }, { "name" : "addEvents", "type" : "function", 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' }); } diff --git a/docs/symbols/Roo.bootstrap.CardUploader.json b/docs/symbols/Roo.bootstrap.CardUploader.json index cbbcc95d94..23c53b1150 100644 --- a/docs/symbols/Roo.bootstrap.CardUploader.json +++ b/docs/symbols/Roo.bootstrap.CardUploader.json @@ -338,6 +338,27 @@ } ], "methods" : [ + { + "name" : "addCard", + "desc" : "addCard - add an Attachment to the uploader", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "memberOf" : "Roo.bootstrap.CardUploader", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "data", + "type" : "", + "desc" : "- the data about the image to upload\n\n{\n id : 123\n title : \"Title of file\",\n is_uploaded : false,\n src : \"http://.....\",\n srcfile : { the File upload object },\n mimetype : file.type,\n preview : false,\n is_deleted : 0\n .. any other data...\n }", + "isOptional" : false + } + ], + "returns" : [] + }, { "name" : "setText", "desc" : "set the text of the first selected button", @@ -1018,6 +1039,54 @@ } ], "events" : [ + { + "name" : "download", + "desc" : "When a the download link is clicked", + "memberOf" : "Roo.bootstrap.CardUploader", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.bootstrap.Card", + "desc" : "", + "isOptional" : false + }, + { + "name" : "The", + "type" : "Object", + "desc" : "image information data contains", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "preview", + "desc" : "When a image is clicked on - and needs to display a slideshow or similar..", + "memberOf" : "Roo.bootstrap.CardUploader", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "this", + "type" : "Roo.bootstrap.Card", + "desc" : "", + "isOptional" : false + }, + { + "name" : "The", + "type" : "Object", + "desc" : "image information data", + "isOptional" : false + } + ], + "returns" : [] + }, { "name" : "toggle", "desc" : "After the button has been toggles", -- 2.39.2