diff options
| author | Robin Appelman | 2017-09-21 19:42:56 +0200 |
|---|---|---|
| committer | rr- | 2017-09-23 20:05:57 +0200 |
| commit | 253e28c1b5e6757057c0dd36a11fd5063e07ff79 (patch) | |
| tree | 508b733f008727f4ca0872899a3f5414e28de211 /client | |
| parent | 6d78c5e55d28e6eea09a0cd873491b3ae52cefa4 (diff) | |
client/posts: add shortcut for deleting posts
Diffstat (limited to 'client')
| -rw-r--r-- | client/html/help_keyboard.tpl | 5 | ||||
| -rw-r--r-- | client/js/views/post_main_view.js | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/client/html/help_keyboard.tpl b/client/html/help_keyboard.tpl index 5b12324..76bfe2a 100644 --- a/client/html/help_keyboard.tpl +++ b/client/html/help_keyboard.tpl @@ -33,6 +33,11 @@ shortcuts:</p> <td><kbd>P</kbd></td> <td>Focus first post in post list</td> </tr> + + <tr> + <td><kbd>Delete</kbd></td> + <td>Delete post (while in edit mode)</td> + </tr> </tbody> </table> diff --git a/client/js/views/post_main_view.js b/client/js/views/post_main_view.js index d303c21..3aa6c4f 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) { |