mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 01:03:31 +02: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
|
// Trigger action click on pressing enter and if the value of applyAction is not equal to -1
|
||||||
$(window).on('keypress', function(e) {
|
$(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();
|
e.preventDefault();
|
||||||
$('#applyAction').trigger('click');
|
$('#applyAction').trigger('click');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user