From: Matthias Schmidt Date: Mon, 3 Jun 2013 15:00:08 +0000 (+0200) Subject: Removes attachment limit-reached error if an attachment is deleted X-Git-Tag: 2.0.0_Beta_3~18^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=637f883a826fbac64d026f9f38266c2c4e9fcbdd;p=GitHub%2FWoltLab%2FWCF.git Removes attachment limit-reached error if an attachment is deleted --- diff --git a/wcfsetup/install/files/js/WCF.Attachment.js b/wcfsetup/install/files/js/WCF.Attachment.js index 5065da818b..167660212a 100644 --- a/wcfsetup/install/files/js/WCF.Attachment.js +++ b/wcfsetup/install/files/js/WCF.Attachment.js @@ -53,6 +53,8 @@ WCF.Attachment.Upload = WCF.Upload.extend({ this._buttonSelector.children('p.button').click($.proxy(this._validateLimit, this)); this._fileListSelector.find('.jsButtonInsertAttachment').click($.proxy(this._insert, this)); + + WCF.DOMNodeRemovedHandler.addCallback('WCF.Attachment.Upload', $.proxy(this._removeLimitError, this)); }, /** @@ -84,6 +86,17 @@ WCF.Attachment.Upload = WCF.Upload.extend({ return true; }, + /** + * Removes the limit error message. + * + * @param object event + */ + _removeLimitError: function(event) { + var $target = $(event.target); + if ($target.is('li.box48') && $target.parent().wcfIdentify() === this._fileListSelector.wcfIdentify()) { + this._buttonSelector.next('small.innerError').remove(); + } + }, /** * @see WCF.Upload._upload()