Removes attachment limit-reached error if an attachment is deleted
authorMatthias Schmidt <gravatronics@live.com>
Mon, 3 Jun 2013 15:00:08 +0000 (17:00 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 3 Jun 2013 15:00:08 +0000 (17:00 +0200)
wcfsetup/install/files/js/WCF.Attachment.js

index 5065da818b8e6b1dd6b7c7a58ed37d0722997bd1..167660212a1f93b10f027aba84e189656980f2e6 100644 (file)
@@ -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()