From 5182e69dcd95026c5724af18f6ace99900fa623e Mon Sep 17 00:00:00 2001 From: Linty Date: Fri, 6 Dec 2024 12:02:46 +0100 Subject: [PATCH] fixes #2286 trigger the click action on pressing enter ...and if the value of applyAction is not equal to -1 --- admin/themes/default/js/batchManagerGlobal.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/admin/themes/default/js/batchManagerGlobal.js b/admin/themes/default/js/batchManagerGlobal.js index 9413d65c8..199235865 100644 --- a/admin/themes/default/js/batchManagerGlobal.js +++ b/admin/themes/default/js/batchManagerGlobal.js @@ -224,6 +224,14 @@ function selectDelDerivNone() { $('#action_delete_derivatives input[name="del_derivatives_type[]"]').prop("checked", false).trigger("change"); } +// Trigger action click on pressing enter and if the value of applyAction is not equal to -1 +$(window).on('keypress', function(e) { + if (e.key === "Enter" && $("select[name='selectAction']").val() != -1) { + e.preventDefault(); + $('#applyAction').trigger('click'); + } +}); + /* sync metadatas or delete photos by blocks, with progress bar */ jQuery('#applyAction').click(function(e) { if (typeof(elements) != "undefined") {