From: Benoît Pin Date: Tue, 13 Aug 2013 10:04:25 +0000 (+0200) Subject: Introduction du callback « progressHandlerCB ». X-Git-Url: https://svn.cri.ensmp.fr/git/Plinn.git/commitdiff_plain/bb34b7f0c5ace769d9f91ab5c90e5a10b2dfd1fe?ds=inline;hp=c00b819ea88b5055e4fd8bc94d7ee6ea7d02ad49 Introduction du callback « progressHandlerCB ». --- 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); } };