Fix ctrl-enter handling in forms (so that it goes through Intercooler_

This commit is contained in:
Jason McBrayer 2019-03-29 20:09:18 -04:00
parent c28c5af2bb
commit 393dad26bf
5 changed files with 5 additions and 12 deletions

View File

@ -11,9 +11,7 @@
$(".modal-background").on("click", function () { $("#new-toot-modal").toggleClass("is-active"); }); $(".modal-background").on("click", function () { $("#new-toot-modal").toggleClass("is-active"); });
Mousetrap.bind('ctrl+enter', function(e) { Mousetrap.bind('ctrl+enter', function(e) {
var form = document.querySelector('#post-form'); Intercooler.triggerRequest("#post-form");
form.submit();
return true;
}); });
Mousetrap.bind('esc', function(e) { $("#new-toot-modal").toggleClass("is-active"); }); Mousetrap.bind('esc', function(e) { $("#new-toot-modal").toggleClass("is-active"); });
</script> </script>

View File

@ -14,9 +14,7 @@
<script type="application/javascript"> <script type="application/javascript">
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
Mousetrap.bind('ctrl+enter', function(e) { Mousetrap.bind('ctrl+enter', function(e) {
var form = document.querySelector('#post-form'); Intercooler.triggerRequest("#post-form");
form.submit();
return true;
}); });
}); });
</script> </script>

View File

@ -33,9 +33,7 @@ Brutaldon ({{ own_acct.username }}) - reply
<script type="application/javascript"> <script type="application/javascript">
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
Mousetrap.bind('ctrl+enter', function(e) { Mousetrap.bind('ctrl+enter', function(e) {
var form = document.querySelector('#post-form'); Intercooler.triggerRequest("#post-form");
form.submit();
return true;
}); });
}); });
</script> </script>

View File

@ -65,9 +65,7 @@
<script type="application/javascript"> <script type="application/javascript">
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
Mousetrap.bind('ctrl+enter', function(e) { Mousetrap.bind('ctrl+enter', function(e) {
var form = document.querySelector('#post-form'); Intercooler.triggerRequest("#post-form");
form.submit();
return true;
}); });
}); });
</script> </script>

View File

@ -187,6 +187,7 @@
redraft redraft
</a> </a>
<a class="level-item" href="{% url "delete" toot.id %}" <a class="level-item" href="{% url "delete" toot.id %}"
ic-enhance="false"
ic-delete-from="{% url "delete" toot.id %}" ic-delete-from="{% url "delete" toot.id %}"
ic-indicator="#toot-spinner-{{toot.id}}" ic-indicator="#toot-spinner-{{toot.id}}"
ic-confirm="Really delete that toot?" ic-confirm="Really delete that toot?"