From 5120a971c9eb1d3ec11d338313c57e92af610fe9 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 20 Nov 2020 14:24:42 +0800 Subject: [PATCH] Roo/bootstrap/CardUploader.js --- Roo/bootstrap/CardUploader.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Roo/bootstrap/CardUploader.js b/Roo/bootstrap/CardUploader.js index 086bbf47d1..18f7cdc6c6 100644 --- a/Roo/bootstrap/CardUploader.js +++ b/Roo/bootstrap/CardUploader.js @@ -70,6 +70,7 @@ Roo.extend(Roo.bootstrap.CardUploader, Roo.bootstrap.Button, { initEvents : function() { + Roo.bootstrap.Button.prototype.initEvents.call(this); this.urlAPI = (window.createObjectURL && window) || (window.URL && URL.revokeObjectURL && URL) || (window.webkitURL && webkitURL); @@ -79,8 +80,7 @@ Roo.extend(Roo.bootstrap.CardUploader, Roo.bootstrap.Button, { this.selectorEl = this.el.select('.roo-card-upload-selector', true).first(); - this.el.on('click', this.beforeSelectFile, this); - 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) { @@ -94,7 +94,7 @@ Roo.extend(Roo.bootstrap.CardUploader, Roo.bootstrap.Button, { }, - beforeSelectFile : function(e) + onClick : function(e) { e.preventDefault(); -- 2.39.2