mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-26 19:29:58 +03:00
fixes #2310 check whether there is a textarea when pressing enter
This commit is contained in:
parent
0cce9ef09d
commit
64064b5974
1 changed files with 3 additions and 1 deletions
|
@ -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');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue