From 253e28c1b5e6757057c0dd36a11fd5063e07ff79 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 21 Sep 2017 19:42:56 +0200 Subject: [PATCH] client/posts: add shortcut for deleting posts --- client/html/help_keyboard.tpl | 5 +++++ client/js/views/post_main_view.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/client/html/help_keyboard.tpl b/client/html/help_keyboard.tpl index 5b12324b..76bfe2a2 100644 --- a/client/html/help_keyboard.tpl +++ b/client/html/help_keyboard.tpl @@ -33,6 +33,11 @@ shortcuts:

P Focus first post in post list + + + Delete + Delete post (while in edit mode) + diff --git a/client/js/views/post_main_view.js b/client/js/views/post_main_view.js index d303c21b..3aa6c4fb 100644 --- a/client/js/views/post_main_view.js +++ b/client/js/views/post_main_view.js @@ -77,6 +77,11 @@ class PostMainView { router.show(ctx.getPostUrl(ctx.nextPostId, ctx.parameters)); } }); + keyboard.bind('del', (e) => { + if (ctx.editMode) { + this.sidebarControl._evtDeleteClick(e); + } + }); } _installSidebar(ctx) {