js: add "ctrl+enter to submit form" shortcut.

Press Ctrl+Enter inside any text box to submit the form.
This commit is contained in:
evazion
2019-10-31 00:20:09 -05:00
parent 9cfb753c1b
commit 91fd5e1bff
4 changed files with 23 additions and 25 deletions

View File

@@ -67,9 +67,9 @@ Utility.dialog = function(title, html) {
});
}
Utility.keydown = function(keys, namespace, handler) {
Utility.keydown = function(keys, namespace, handler, selector = document) {
if (CurrentUser.data("enable-post-navigation")) {
$(document).on("keydown.danbooru." + namespace, null, keys, handler);
$(selector).on("keydown.danbooru." + namespace, null, keys, handler);
}
};