From bb34b7f0c5ace769d9f91ab5c90e5a10b2dfd1fe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Tue, 13 Aug 2013 12:04:25 +0200 Subject: [PATCH] =?utf8?q?Introduction=20du=20callback=20=C2=AB=C2=A0progr?= =?utf8?q?essHandlerCB=C2=A0=C2=BB.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- skins/fileupload.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/skins/fileupload.js b/skins/fileupload.js index 0aebb3e..318f059 100644 --- a/skins/fileupload.js +++ b/skins/fileupload.js @@ -111,12 +111,15 @@ DDFileUploaderBase.prototype.uploadCompleteHandler = function(req) { this.uploadQueueLoadNext(); }; +DDFileUploaderBase.prototype.progressHandlerCB = function(progress) { + // To be implemented by descendant. + // 0 <= progress <= 1 +}; + DDFileUploaderBase.prototype.progressHandler = function(evt) { if (evt.lengthComputable) { var progress = evt.loaded / evt.total; - this.updateProgressBar(progress); - var currentOpacity = this.previewImg.style.opacity; - this.previewImg.style.opacity = Math.max(currentOpacity, progress); + this.progressHandlerCB(progress); } }; -- 2.20.1