Add global ctrl/meta-enter shortcut for form submission

Wants rewriting for better efficiency, but hey, it works!
This commit is contained in:
2020-06-15 16:15:23 +01:00
parent 9e1d146b7a
commit 6e7fa267bc
4 changed files with 12 additions and 12 deletions

View File

@@ -28,6 +28,16 @@
{% endblock %}
{% block extra-head %}{% endblock %}
<script>
document.body.addEventListener('keydown', function(e) {
if(e.keyCode == 13 && (e.metaKey || e.ctrlKey)) {
var target = e.target;
if(target.form) {
target.form.submit();
}
}
});
</script>
</head>
<body>