Merge pull request #791 from ArthurHoaro/feature/ctrl-enter-submit
Submit editlink textarea using CTRL+Enter shortcut
This commit is contained in:
commit
1e38df6606
2 changed files with 8 additions and 1 deletions
|
@ -59,7 +59,7 @@
|
|||
|
||||
|
||||
<div class="submit-buttons center">
|
||||
<input type="submit" value="{'Save'|t}" name="save_edit" class="">
|
||||
<input type="submit" value="{'Save'|t}" name="save_edit" class="" id="button-save-edit">
|
||||
{if="!$link_is_new"}
|
||||
<a href="?delete_link&lf_linkdate={$link.id}&token={$token}"
|
||||
title="" name="delete_link" class="button button-red confirm-delete">
|
||||
|
|
|
@ -256,7 +256,14 @@ window.onload = function () {
|
|||
|
||||
resize();
|
||||
}
|
||||
|
||||
if (description != null) {
|
||||
init();
|
||||
// Submit editlink form with CTRL + Enter in the text area.
|
||||
description.addEventListener('keydown', function (event) {
|
||||
if (event.ctrlKey && event.keyCode === 13) {
|
||||
document.getElementById('button-save-edit').click();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue