From: Joshua Rüsweg Date: Sun, 20 Jan 2019 18:38:21 +0000 (+0100) Subject: Remove errors on upload X-Git-Tag: 5.2.0_Alpha_1~296^2~30 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f304600a744787ee01ceaa136c0fc5073a7d9e90;p=GitHub%2FWoltLab%2FWCF.git Remove errors on upload See #2825 --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js index fae2649eac..25743c85da 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js @@ -122,6 +122,13 @@ define(['Core', 'Language', 'Dom/Util', 'WoltLabSuite/Core/Ui/File/Delete', 'Upl throw new Error("Upload failed: " + data.message); }, + _upload: function(event, file, blob) { + var innerError = elBySel('small.innerError:not(.innerFileError)', this._buttonContainer.parentNode); + if (innerError) elRemove(innerError); + + return Upload._super.prototype._upload.call(this, event, file, blob); + }, + _success: function(uploadId, data, responseText, xhr, requestOptions) { for (var i in this._fileElements[uploadId]) { if (data['files'][i] !== undefined) { @@ -199,7 +206,9 @@ define(['Core', 'Language', 'Dom/Util', 'WoltLabSuite/Core/Ui/File/Delete', 'Upl DomUtil.insertAfter(innerError, this._buttonContainer); } - innerError.textContent = WCF.Language.get('wcf.upload.error.reachedRemainingLimit').replace(/#remaining#/, this._options.maxFiles); + innerError.textContent = Language.get('wcf.upload.error.reachedRemainingLimit', { + maxFiles: this._options.maxFiles - this.countFiles() + }); return false; }