Make comments cache-safe
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { Controller } from "@hotwired/stimulus"
|
||||
|
||||
export default class extends Controller {
|
||||
static classes = [ "myComment" ]
|
||||
|
||||
connect() {
|
||||
this.#myComments.forEach(comment => comment.classList.add(this.myCommentClass))
|
||||
}
|
||||
|
||||
get #myComments() {
|
||||
return this.element.querySelectorAll(`.comment[data-creator-id='${Current.user.id}']`)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user