Aevann 2023-10-15 18:51:59 +03:00
parent 5fc27db8d4
commit 502fb2bb64
2 changed files with 7 additions and 1 deletions

View File

@ -324,6 +324,12 @@ function post_comment(fullname, hide){
remove_dialog();
if (fullname.startsWith('c_'))
restore_reply_buttons(fullname)
if (fullname.startsWith('p_')) {
const viewbtn = document.getElementById('viewbtn')
if (viewbtn)
viewbtn.dataset.ids = viewbtn.dataset.ids.slice(0, -1) + `, ${data['id']}]`
}
}
else {
showToast(false, getMessageFromJsonData(false, data));

View File

@ -426,7 +426,7 @@ def comment(v):
gevent.spawn(postprocess_comment, c.body, c.body_html, c.id)
if v.client: return c.json
return {"comment": render_template("comments.html", v=v, comments=[c])}
return {"id": c.id, "comment": render_template("comments.html", v=v, comments=[c])}
@app.post("/delete/comment/<int:cid>")
@limiter.limit('1/second', scope=rpath)