]> cat aescling's git repositories - mastodon.git/commitdiff
fixed ctrl enter
authorOndřej Hruška <ondra@ondrovo.com>
Sat, 6 Jan 2018 18:58:04 +0000 (19:58 +0100)
committerOndřej Hruška <ondra@ondrovo.com>
Sat, 6 Jan 2018 18:58:04 +0000 (19:58 +0100)
app/javascript/flavours/glitch/features/composer/textarea/index.js

index 0f5fd4d4d74773c6fbb76c6cf497cde619b2a7c4..6c2b8baa2e8db1eb51b671dc1637d73263a8210a 100644 (file)
@@ -128,6 +128,11 @@ const handlers = {
       return;
     }
 
+    //  We submit the status on control/meta + enter.
+    if (onSubmit && e.keyCode === 13 && (e.ctrlKey || e.metaKey)) {
+      onSubmit();
+    }
+
     //  Switches over the pressed key.
     switch(e.key) {
 
@@ -157,11 +162,6 @@ const handlers = {
       }
       return;
     }
-
-    //  We submit the status on control/meta + enter.
-    if (onSubmit && e.keyCode === 13 && (e.ctrlKey || e.metaKey)) {
-      onSubmit();
-    }
   },
 
   //  When the escape key is released, we either close the suggestions