fixes #2286 trigger the click action on pressing enter

...and if the value of applyAction is not equal to -1
This commit is contained in:
Linty 2024-12-06 12:02:46 +01:00
parent 9e9fb327f0
commit 5182e69dcd

View file

@ -224,6 +224,14 @@ function selectDelDerivNone() {
$('#action_delete_derivatives input[name="del_derivatives_type[]"]').prop("checked", false).trigger("change"); $('#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 */ /* sync metadatas or delete photos by blocks, with progress bar */
jQuery('#applyAction').click(function(e) { jQuery('#applyAction').click(function(e) {
if (typeof(elements) != "undefined") { if (typeof(elements) != "undefined") {