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

2
TODO
View File

@@ -1,6 +1,4 @@
## GENERAL
* delete key bound to del dbox
* ai search, should put 'all' at top of drop-down
* add an option on the person menu to run_ai_on all photos (or at least import/storage)

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 %}