From 393dad26bf7f563c9ce1206439aae43f0fbef25a Mon Sep 17 00:00:00 2001 From: Jason McBrayer Date: Fri, 29 Mar 2019 20:09:18 -0400 Subject: [PATCH] Fix ctrl-enter handling in forms (so that it goes through Intercooler_ --- brutaldon/templates/intercooler/post.html | 4 +--- brutaldon/templates/main/post.html | 4 +--- brutaldon/templates/main/redraft.html | 4 +--- brutaldon/templates/main/timeline.html | 4 +--- brutaldon/templates/main/toot_partial.html | 1 + 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/brutaldon/templates/intercooler/post.html b/brutaldon/templates/intercooler/post.html index 35c3519..76fff28 100644 --- a/brutaldon/templates/intercooler/post.html +++ b/brutaldon/templates/intercooler/post.html @@ -11,9 +11,7 @@ $(".modal-background").on("click", function () { $("#new-toot-modal").toggleClass("is-active"); }); Mousetrap.bind('ctrl+enter', function(e) { - var form = document.querySelector('#post-form'); - form.submit(); - return true; + Intercooler.triggerRequest("#post-form"); }); Mousetrap.bind('esc', function(e) { $("#new-toot-modal").toggleClass("is-active"); }); diff --git a/brutaldon/templates/main/post.html b/brutaldon/templates/main/post.html index 3d268da..987baa2 100644 --- a/brutaldon/templates/main/post.html +++ b/brutaldon/templates/main/post.html @@ -14,9 +14,7 @@ diff --git a/brutaldon/templates/main/redraft.html b/brutaldon/templates/main/redraft.html index 30ee1a1..c43efd2 100644 --- a/brutaldon/templates/main/redraft.html +++ b/brutaldon/templates/main/redraft.html @@ -33,9 +33,7 @@ Brutaldon ({{ own_acct.username }}) - reply diff --git a/brutaldon/templates/main/timeline.html b/brutaldon/templates/main/timeline.html index b7b41b0..e050b49 100644 --- a/brutaldon/templates/main/timeline.html +++ b/brutaldon/templates/main/timeline.html @@ -65,9 +65,7 @@ diff --git a/brutaldon/templates/main/toot_partial.html b/brutaldon/templates/main/toot_partial.html index 263d824..4dbac9f 100644 --- a/brutaldon/templates/main/toot_partial.html +++ b/brutaldon/templates/main/toot_partial.html @@ -187,6 +187,7 @@ redraft