Skip to content
Snippets Groups Projects
Commit c19f9abf authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#540 - save transactions and templates with hotkey (ctrl + enter)

parent 5c3de3f8
Branches
Tags
No related merge requests found
......@@ -55,6 +55,14 @@ Mousetrap.bind('esc', function()
}
});
let saveTransactionOrTemplateButton = document.getElementById('button-save-transaction');
if(saveTransactionOrTemplateButton !== null)
{
Mousetrap(document.querySelector('body')).bind('mod+enter', function(e)
{
document.getElementById('button-save-transaction').click();
});
}
function areHotKeysEnabled()
{
......
......@@ -157,6 +157,11 @@ $(document).ready(function()
// prevent form submit on enter (otherwise tag functionality will be hard to use)
$(document).on("keypress", 'form', function(e)
{
if(e.ctrlKey)
{
return true;
}
let code = e.keyCode || e.which;
if(code === 13)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment