mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-19 14:32:16 +00:00
Add global ctrl/meta-enter shortcut for form submission
Wants rewriting for better efficiency, but hey, it works!
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user