mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:30:26 -06:00
UX: ask for confirmation when deleting a post using shortcut (#16526)
This commit is contained in:
parent
c1d9822003
commit
3e0cb8ea47
@ -702,6 +702,19 @@ export default Controller.extend(bufferedProperty("model"), {
|
||||
}
|
||||
},
|
||||
|
||||
deletePostWithConfirmation(post, opts) {
|
||||
bootbox.confirm(
|
||||
I18n.t("post.confirm_delete"),
|
||||
I18n.t("no_value"),
|
||||
I18n.t("yes_value"),
|
||||
(confirmed) => {
|
||||
if (confirmed) {
|
||||
this.send("deletePost", post, opts);
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
permanentlyDeletePost(post) {
|
||||
return bootbox.confirm(
|
||||
I18n.t("post.controls.permanently_delete_confirmation"),
|
||||
|
@ -49,7 +49,7 @@ const DEFAULT_BINDINGS = {
|
||||
"command+right": { handler: "webviewKeyboardForward", anonymous: true },
|
||||
"command+]": { handler: "webviewKeyboardForward", anonymous: true },
|
||||
"mod+p": { handler: "printTopic", anonymous: true },
|
||||
d: { postAction: "deletePost" },
|
||||
d: { postAction: "deletePostWithConfirmation" },
|
||||
e: { handler: "editPost" },
|
||||
end: { handler: "goToLastPost", anonymous: true },
|
||||
"command+down": { handler: "goToLastPost", anonymous: true },
|
||||
|
@ -3053,6 +3053,7 @@ en:
|
||||
deleted_by_author_simple: "(topic deleted by author)"
|
||||
|
||||
post:
|
||||
confirm_delete: "Are you sure you want to delete this post?"
|
||||
quote_reply: "Quote"
|
||||
quote_reply_shortcut: "Or press q"
|
||||
quote_edit: "Edit"
|
||||
|
Loading…
Reference in New Issue
Block a user