update comment ping cost on edit
parent
4623e7c1a3
commit
2e80ebdc0d
|
@ -218,6 +218,10 @@ function comment_edit(id){
|
|||
|
||||
document.getElementById('comment-edit-body-' + id).value = data["body"];
|
||||
|
||||
const ping_cost = document.getElementById('comment-ping-cost-' + id)
|
||||
ping_cost.innerText = data["ping_cost"];
|
||||
ping_cost.parentElement.classList.remove('d-none')
|
||||
|
||||
const input = ta.parentElement.querySelector('input[type="file"]')
|
||||
input.previousElementSibling.innerHTML = '';
|
||||
input.value = null;
|
||||
|
|
|
@ -680,4 +680,4 @@ def edit_comment(cid, v):
|
|||
|
||||
|
||||
g.db.flush()
|
||||
return {"body": c.body, "comment": c.realbody(v)}
|
||||
return {"body": c.body, "comment": c.realbody(v), "ping_cost": c.ping_cost}
|
||||
|
|
|
@ -224,9 +224,9 @@
|
|||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if c.ping_cost %}
|
||||
<em class="ml-2">spent {{c.ping_cost}} currency on pings</em>
|
||||
{% endif %}
|
||||
<em class="ml-2 {% if not c.ping_cost %}d-none{% endif %}">
|
||||
spent <span id="comment-ping-cost-{{c.id}}">{{c.ping_cost}}</span> currency on pings
|
||||
</em>
|
||||
|
||||
{% if c.slots_result %}
|
||||
<em class="ml-2">{{c.slots_result}}</em>
|
||||
|
|
Loading…
Reference in New Issue