Introduction du callback « progressHandlerCB ».
authorBenoît Pin <pin@cri.ensmp.fr>
Tue, 13 Aug 2013 10:04:25 +0000 (12:04 +0200)
committerBenoît Pin <pin@cri.ensmp.fr>
Tue, 13 Aug 2013 10:04:25 +0000 (12:04 +0200)
skins/fileupload.js
skins/portfolio_upload.js

index 0aebb3e..318f059 100644 (file)
@@ -111,12 +111,15 @@ DDFileUploaderBase.prototype.uploadCompleteHandler = function(req) {
        this.uploadQueueLoadNext();
 };
 
        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;
 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);
        }
 };
 
        }
 };
 
index 653e802..c9c492a 100644 (file)
@@ -50,6 +50,11 @@ DDImageUploader.prototype.beforeUpload = function(slide) {
        this.progressBar = slide.progressBar;
 };
 
        this.progressBar = slide.progressBar;
 };
 
+DDImageUploader.prototype.progressHandlerCB = function(progress) {
+       this.updateProgressBar(progress);
+       var currentOpacity = this.previewImg.style.opacity;
+       this.previewImg.style.opacity = Math.max(currentOpacity, progress);
+};
 
 // Methods about preview queue.
 DDImageUploader.prototype.previewQueuePush = function(slide) {
 
 // Methods about preview queue.
 DDImageUploader.prototype.previewQueuePush = function(slide) {