mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-12 17:49:41 +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:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -137,4 +137,3 @@ $("#item-table tbody").sortable({
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,16 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block extra-head %}{% 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>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
Reference in New Issue
Block a user