Improved flood control handling for comments
authorAlexander Ebert <ebert@woltlab.com>
Sun, 15 Sep 2013 13:54:17 +0000 (15:54 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 15 Sep 2013 13:54:17 +0000 (15:54 +0200)
wcfsetup/install/files/js/WCF.Comment.js

index c67f083d9ccf4e378688b87a951685273846fdc6..58b2fc17093b4277aff952034e81497b70de18ea 100644 (file)
@@ -447,7 +447,7 @@ WCF.Comment.Handler = Class.extend({
                this._proxy.sendRequest();
                
                // reset input
-               $input.val('').blur();
+               //$input.val('').blur();
        },
        
        /**
@@ -492,11 +492,14 @@ WCF.Comment.Handler = Class.extend({
        _success: function(data, textStatus, jqXHR) {
                switch (data.actionName) {
                        case 'addComment':
+                               this._commentAdd.find('input').val('').blur();
                                $(data.returnValues.template).insertAfter(this._commentAdd).wcfFadeIn();
                        break;
                        
                        case 'addResponse':
                                var $comment = this._comments[data.returnValues.commentID];
+                               $comment.find('.jsCommentResponseAdd input').val('').blur();
+                               
                                var $responseList = $comment.find('ul.commentResponseList');
                                if (!$responseList.length) $responseList = $('<ul class="commentResponseList" />').insertBefore($comment.find('.commentOptionContainer'));
                                $(data.returnValues.template).appendTo($responseList).wcfFadeIn();