Del key bound for delete on files page

This commit is contained in:
2021-09-20 21:18:02 +10:00
parent 0d9d1c01db
commit a67b0cc16c
2 changed files with 13 additions and 2 deletions

View File

@@ -351,5 +351,18 @@ $(document).ready(function() {
}
$(".dir").click( function(e) { $('#offset').val(0) ; $('#cwd').val( $(this).attr('dir') ) ; $('#main_form').submit() } )
} )
$( document ).keydown(function(event) {
switch (event.key)
{
case "Delete":
{% if "files_rbp" in request.url %}
if( ! NoSel() ) DelDBox('Restore');
{% else %}
if( ! NoSel() ) DelDBox('Delete');
{% endif %}
break;
}
});
</script>
{% endblock script_content %}