var $commentID = $comment.data('commentID');
self._comments[$commentID] = $comment;
- var $container = $('<div class="commentOptionContainer" />').hide().insertAfter($comment.find('ul.commentResponseList'));
+ var $insertAfter = $comment.find('ul.commentResponseList');
+ if (!$insertAfter.length) $insertAfter = $comment.find('.commentContent');
+
+ $container = $('<div class="commentOptionContainer" />').hide().insertAfter($insertAfter);
self._commentButtonList[$commentID] = $('<ul />').appendTo($container);
self._handleLoadNextResponses($commentID);
if ($placeholder !== null) {
$listItem.hide();
}
+ else {
+ this._commentButtonList[commentID].parent().addClass('jsAddResponseActive');
+ }
$listItem.appendTo(this._commentButtonList[commentID].parent().show());
var $inputContainer = $listItem.children('div');
var $responseInput = this._comments[$commentID].data('responseInput').show();
$responseInput.find('input').focus();
+
+ $responseInput.parents('.commentOptionContainer').addClass('jsAddResponseActive');
},
/**
break;
case 'addResponse':
- $(data.returnValues.template).appendTo(this._comments[data.returnValues.commentID].find('ul.commentResponseList')).wcfFadeIn();
+ var $comment = this._comments[data.returnValues.commentID];
+ var $responseList = $comment.find('ul.commentResponseList');
+ if (!$responseList.length) $responseList = $('<ul class="commentResponseList" />').insertBefore($comment.find('.commentOptionContainer'));
+ $(data.returnValues.template).appendTo($responseList).wcfFadeIn();
break;
case 'edit':