| 12 | export const singleParagraphCommentSelector = '.comment-body > p:only-child'; |
| 13 | |
| 14 | async function unhide(event: DelegateEvent): Promise<void> { |
| 15 | for (const comment of $$('.rgh-hidden-comment')) { |
| 16 | comment.hidden = false; |
| 17 | } |
| 18 | |
| 19 | await delay(10); // "Similar comments" aren't expanded without this in Safari #3830 |
| 20 | |
| 21 | // Expand all "similar comments" boxes |
| 22 | for (const similarCommentsExpandButton of $$('.rgh-hidden-comment > summary')) { |
| 23 | similarCommentsExpandButton.click(); |
| 24 | } |
| 25 | |
| 26 | $('.rgh-hidden-comment').scrollIntoView(); |
| 27 | event.delegateTarget.parentElement!.remove(); |
| 28 | } |
| 29 | |
| 30 | function hideComment(comment: HTMLElement): void { |
| 31 | comment.hidden = true; |