Revert response input on reply
authorAlexander Ebert <ebert@woltlab.com>
Thu, 9 Mar 2017 11:59:28 +0000 (12:59 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 9 Mar 2017 11:59:28 +0000 (12:59 +0100)
See #2233

wcfsetup/install/files/js/WCF.Comment.js

index 5579aafd9a615b988c1468631609f855c3c02f5a..5304baddd4aa2ae2fa37a041b35bf7540513e9b5 100644 (file)
@@ -598,7 +598,7 @@ WCF.Comment.Handler = Class.extend({
                        $placeholder.parent().children('.button').disable();
                }
                
-               $placeholder.remove();
+               $placeholder.hide();
                
                var $responseInput = this._comments[$commentID].data('responseInput').show();
                $responseInput.find('textarea').focus();
@@ -765,6 +765,11 @@ WCF.Comment.Handler = Class.extend({
                                        var $comment = this._comments[data.returnValues.commentID];
                                        $comment.find('.jsCommentResponseAdd textarea').val('').blur().trigger('updateHeight');
                                        
+                                       // revert response field
+                                       elBySel('.commentOptionContainer', $comment[0]).classList.remove('jsAddResponseActive');
+                                       elHide(elBySel('.jsCommentResponseAdd', $comment[0]));
+                                       elShow(elBySel('.jsCommentShowAddResponse', $comment[0]));
+                                       
                                        var $responseList = $comment.find('ul.commentResponseList');
                                        if (!$responseList.length) $responseList = $('<ul class="containerList commentResponseList" />').insertBefore($comment.find('.commentOptionContainer'));
                                        $(data.returnValues.template).appendTo($responseList).wcfFadeIn();