diff options
author | HombreLaser <sebastian-440@live.com> | 2024-02-21 12:12:52 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2024-02-21 12:12:52 -0600 |
commit | d5d73505832bb39cf8e7fa5a49ff8e3d56690d71 (patch) | |
tree | fd562db4c6872ffc65b27e4be712c162015d621a /static/js/controllers/comments_controller.js | |
parent | 11799b5bb5cac1fb53ea676337e679c94d3bc3e8 (diff) |
Add reply form rendering
Diffstat (limited to 'static/js/controllers/comments_controller.js')
-rw-r--r-- | static/js/controllers/comments_controller.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/static/js/controllers/comments_controller.js b/static/js/controllers/comments_controller.js index 5e725ce..08f9548 100644 --- a/static/js/controllers/comments_controller.js +++ b/static/js/controllers/comments_controller.js @@ -1,8 +1,9 @@ import { BaseController } from "./base_controller.js"; export class CommentsController extends BaseController { - constructor(domain) { - super(domain); + constructor(replies_controller) { + super(); + this.replies_controller = replies_controller; this.comments_node = document.getElementById("comments-thread"); this.renderForm(); this.renderComments(); @@ -24,8 +25,10 @@ export class CommentsController extends BaseController { this.get(`/api/comments?path=${this.post}`).then((value) => { const comments = value?.getElementById("comment-section"); - if(comments != null) + if(comments != null) { this.comments_node.appendChild(comments); + this.replies_controller.init(); + } }); } |