From f80f8f09cca6aedb569d60b701aab9a0cfee77f3 Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Sun, 17 Apr 2022 20:36:34 +0200 Subject: [PATCH] Wall: Add ability to send posts and comments by Ctrl + Enter Closes #67 --- Web/static/js/al_wall.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Web/static/js/al_wall.js b/Web/static/js/al_wall.js index 35b964da..bee1bb1f 100644 --- a/Web/static/js/al_wall.js +++ b/Web/static/js/al_wall.js @@ -117,3 +117,8 @@ function setupWallPostInputHandlers(id) { // textArea.style.height = (newHeight > originalHeight ? (newHeight + boost) : originalHeight) + "px"; }); } + +u("#write > form").on("keydown", function(event) { + if(event.ctrlKey && event.keyCode === 13) + this.submit(); +});