fix post deletion
This commit is contained in:
parent
fb543919a7
commit
ccc08fa1bc
2 changed files with 3 additions and 12 deletions
13
web/damus.js
13
web/damus.js
|
@ -777,17 +777,6 @@ function render_replying_to(model, ev) {
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
function render_delete_post(model, ev) {
|
|
||||||
if (model.pubkey !== ev.pubkey)
|
|
||||||
return ""
|
|
||||||
|
|
||||||
return `
|
|
||||||
<span onclick="delete_post_confirm('${ev.id}')" class="clickable" style="float: right">
|
|
||||||
✕
|
|
||||||
</span>
|
|
||||||
`
|
|
||||||
}
|
|
||||||
|
|
||||||
function delete_post_confirm(evid) {
|
function delete_post_confirm(evid) {
|
||||||
if (!confirm("Are you sure you want to delete this post?"))
|
if (!confirm("Are you sure you want to delete this post?"))
|
||||||
return
|
return
|
||||||
|
@ -1242,7 +1231,7 @@ function reply_to(evid) {
|
||||||
function render_action_bar(ev, can_delete) {
|
function render_action_bar(ev, can_delete) {
|
||||||
let delete_html = ""
|
let delete_html = ""
|
||||||
if (can_delete)
|
if (can_delete)
|
||||||
delete_html = `<button class="icon" title="Delete" onclick="like('${ev.id}')"><i class="fa fa-fw fa-trash"></i></a>`
|
delete_html = `<button class="icon" title="Delete" onclick="delete_post_confirm('${ev.id}')"><i class="fa fa-fw fa-trash"></i></a>`
|
||||||
|
|
||||||
const groups = get_reactions(DSTATE, ev.id)
|
const groups = get_reactions(DSTATE, ev.id)
|
||||||
const like = "❤️"
|
const like = "❤️"
|
||||||
|
|
|
@ -216,6 +216,7 @@ details.cw summary {
|
||||||
color: #444;
|
color: #444;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Thread Expansion */
|
/* Thread Expansion */
|
||||||
|
@ -315,3 +316,4 @@ input[type="text"].cw {
|
||||||
.clickable {
|
.clickable {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue