Submit editlink textarea using CTRL+Enter shortcut
This commit is contained in:
parent
db0caba3c4
commit
2dd698fd79
2 changed files with 8 additions and 1 deletions
|
@ -59,7 +59,7 @@ <h2 class="window-title">{'Shaare'|t}</h2>
|
|||
|
||||
|
||||
<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