From a67b0cc16c7f1505a9aa98caed72dd501b99aa0d Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Mon, 20 Sep 2021 21:18:02 +1000 Subject: [PATCH] Del key bound for delete on files page --- TODO | 2 -- templates/files.html | 13 +++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 9901183..a7218d3 100644 --- a/TODO +++ b/TODO @@ -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) diff --git a/templates/files.html b/templates/files.html index 45205fe..3ad1252 100644 --- a/templates/files.html +++ b/templates/files.html @@ -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; + } +}); {% endblock script_content %}