From d12f99032053ade5ba1e997632d8ef65358491c5 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 21 Sep 2017 19:42:56 +0200 Subject: [PATCH] Add shortcut for deleting posts while in edit mode --- 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 452d63f9..90eea76b 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(uri.formatClientLink('post', ctx.nextPostId)); } }); + keyboard.bind('del', (e) => { + if (ctx.editMode) { + this.sidebarControl._evtDeleteClick(e); + } + }); } _installSidebar(ctx) {