Skip to content

Commit 98d8109

Browse files
authored
Merge pull request #283 from itk-dev/feature/LOOP-1171-top-answer-styling
LOOP-1171: Fixed assignment of top-comment CSS class
2 parents 54be8bf + 6db8657 commit 98d8109

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

web/profiles/custom/os2loop/modules/os2loop_upvote/src/Helper/FlagHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function preprocessFlag(array &$variables) {
106106
*/
107107
public function preprocessComment(array &$variables) {
108108
if (isset($variables['elements']['#top'])) {
109-
$variables['attributes'] += ['class' => ['top-comment']];
109+
$variables['attributes']['class'][] = 'top-comment';
110110
}
111111
}
112112

web/profiles/custom/os2loop/themes/os2loop_theme/templates/content-entities/comment--os2loop-post-comments.html.twig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@
6767
*/
6868
#}
6969
{% set background_class = [
70-
attributes.hasClass('top-comment') ? 'top-comment-background',
71-
not attributes.hasClass('top-comment') ? 'bg-secondary-loop',
70+
attributes.hasClass('top-comment') ? 'top-comment-background' : 'bg-secondary-loop',
7271
]
7372
%}
7473
{# Remove comment id from element id on top comment #}

web/profiles/custom/os2loop/themes/os2loop_theme/templates/content-entities/comment--os2loop-question-answers.html.twig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@
6767
*/
6868
#}
6969
{% set background_class = [
70-
attributes.hasClass('top-comment') ? 'top-comment-background',
71-
not attributes.hasClass('top-comment') ? 'bg-secondary-loop',
70+
attributes.hasClass('top-comment') ? 'top-comment-background' : 'bg-secondary-loop',
7271
]
7372
%}
7473
{# Remove comment id from element id on top comment #}

0 commit comments

Comments
 (0)