Show the rating above the comment text
The rating has the same height for every comment, so above the text it stays in place while the comments rotate; only the text changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b5ea4e70c8
commit
0660affb56
3 files changed
+8
-8
No files matched your search
@@ -345,18 +345,18 @@
|
||||
// Every comment sits invisibly in the same grid cell as the one shown, so the box is as
|
||||
// tall as the longest comment and the centred stage does not jump while they rotate.
|
||||
var sizers = items.length < 2 ? [] : items.map(function (item) {
|
||||
var hasValue = item.value !== null && item.value !== undefined;
|
||||
return el('div', { class: 'comments__sizer', 'aria-hidden': 'true' }, [
|
||||
el('blockquote', { class: 'comments__text', text: item.text }),
|
||||
hasValue ? el('p', { class: 'comments__value', text: 'Bewertung: ' + Comments.format(item.value) }) : null
|
||||
el('blockquote', { class: 'comments__text', text: item.text })
|
||||
]);
|
||||
});
|
||||
// The rating (same height for every comment, all or none per slide) sits above the
|
||||
// text, so it stays in place while the comments rotate.
|
||||
var node = el('section', { class: 'comments', 'data-comments': '', 'aria-label': 'Kommentare' }, [
|
||||
el('p', { class: 'comments__counter', 'data-comment-counter': '' }),
|
||||
el('p', { class: 'comments__value', 'data-comment-value': '' }),
|
||||
el('div', { class: 'comments__body' }, sizers.concat([
|
||||
el('div', { class: 'comments__current' }, [
|
||||
el('blockquote', { class: 'comments__text', 'data-comment-text': '' }),
|
||||
el('p', { class: 'comments__value', 'data-comment-value': '' })
|
||||
el('blockquote', { class: 'comments__text', 'data-comment-text': '' })
|
||||
])
|
||||
])),
|
||||
// Time left until the next comment; decorative, the counter carries the information.
|
||||
|
||||
Reference in new issue
Block a user