Reset media listing before new upload, not after upload
authorMatthias Schmidt <gravatronics@live.com>
Thu, 29 Dec 2016 06:49:58 +0000 (07:49 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 29 Dec 2016 06:50:01 +0000 (07:50 +0100)
wcfsetup/install/files/js/WoltLabSuite/Core/Media/Upload.js

index 0685432474e1df76b3cdc70106bc0e13b146b489..f62af581966fd16b344361665f4835543e90f8ed 100644 (file)
@@ -126,7 +126,6 @@ define(
                                        
                                        if (this._mediaManager) {
                                                this._mediaManager.setupMediaElement(media, file);
-                                               this._mediaManager.resetMedia();
                                                this._mediaManager.addMedia(media, file);
                                        }
                                }
@@ -163,6 +162,18 @@ define(
                                media: data.returnValues.media,
                                upload: this
                        });
+               },
+               
+               /**
+                * @see WoltLabSuite/Core/Upload#_uploadFiles
+                */
+               _uploadFiles: function(files, blob) {
+                       // reset media (search) before uploading
+                       if (this._mediaManager) {
+                               this._mediaManager.resetMedia();
+                       }
+                       
+                       return MediaUpload._super.prototype._getParameters.call(this, files, blob);
                }
        });