mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
fixes #2310 check whether there is a textarea when pressing enter
This commit is contained in:
@@ -226,7 +226,9 @@ function selectDelDerivNone() {
|
||||
|
||||
// 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) {
|
||||
const selected = $("select[name='selectAction']").val();
|
||||
const haveTextarea = $(`#action_${selected} textarea`).length;
|
||||
if (e.key === "Enter" && selected != -1 && !haveTextarea) {
|
||||
e.preventDefault();
|
||||
$('#applyAction').trigger('click');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user