Fix collision for comment react button and comment response react button
authorjoshuaruesweg <ruesweg@woltlab.com>
Fri, 30 Apr 2021 12:48:57 +0000 (14:48 +0200)
committerjoshuaruesweg <ruesweg@woltlab.com>
Fri, 30 Apr 2021 12:49:31 +0000 (14:49 +0200)
The comment react button can bind onto the comment response react button, if there is no comment react button (e.g. because the comment author is the user themselves). Using an own `buttonSelector` for the comment response react button, fixes the problem.

Note: The problem only becomes visible if there is only one reaction (so WoltLab Suite uses the legacy like mode).

com.woltlab.wcf/templates/__commentJavaScript.tpl
com.woltlab.wcf/templates/commentResponseList.tpl

index aa34a489602dc8016900b0b502ea643817d40d49..7cace22764022319c7088f02909e0b99f1a09ffa 100644 (file)
@@ -28,7 +28,8 @@
                                        // selectors
                                        containerSelector: '#{@$commentContainerID} .commentResponse',
                                        summaryListSelector: '.reactionSummaryList',
-                                       isButtonGroupNavigation: true
+                                       isButtonGroupNavigation: true,
+                                       buttonSelector: '.reactButtonCommentResponse'
                                });
                        });
                {/if}
index 9cd0af5618d1527028474a754ed6dd36c97845c3..90fd8b28e1b068cc71d6f4a508e2e3eed895e9e8 100644 (file)
@@ -50,7 +50,7 @@
                                                                <li class="jsReportCommentResponse jsOnly" data-object-id="{@$response->responseID}"><a href="#" title="{lang}wcf.moderation.report.reportContent{/lang}" class="jsTooltip"><span class="icon icon16 fa-exclamation-triangle"></span> <span class="invisible">{lang}wcf.moderation.report.reportContent{/lang}</span></a></li>
                                                        {/if}
                                                        
-                                                       {if MODULE_LIKE && $commentManager->supportsLike() && $__wcf->session->getPermission('user.like.canLike') && $response->userID != $__wcf->user->userID}<li class="jsOnly"><a href="#" class="reactButton jsTooltip {if $likeData[response][$response->responseID]|isset && $likeData[response][$response->responseID]->reactionTypeID} active{/if}" title="{lang}wcf.reactions.react{/lang}" data-reaction-type-id="{if $likeData[response][$response->responseID]|isset && $likeData[response][$response->responseID]->reactionTypeID}{$likeData[response][$response->responseID]->reactionTypeID}{else}0{/if}"><span class="icon icon16 fa-smile-o"></span> <span class="invisible">{lang}wcf.reactions.react{/lang}</span></a></li>{/if}
+                                                       {if MODULE_LIKE && $commentManager->supportsLike() && $__wcf->session->getPermission('user.like.canLike') && $response->userID != $__wcf->user->userID}<li class="jsOnly"><a href="#" class="reactButtonCommentResponse jsTooltip {if $likeData[response][$response->responseID]|isset && $likeData[response][$response->responseID]->reactionTypeID} active{/if}" title="{lang}wcf.reactions.react{/lang}" data-reaction-type-id="{if $likeData[response][$response->responseID]|isset && $likeData[response][$response->responseID]->reactionTypeID}{$likeData[response][$response->responseID]->reactionTypeID}{else}0{/if}"><span class="icon icon16 fa-smile-o"></span> <span class="invisible">{lang}wcf.reactions.react{/lang}</span></a></li>{/if}
                                                        
                                                        {event name='commentOptions'}
                                                </ul>