mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
show/hide: take selects elements into account
This commit is contained in:
parent
567f3f7ec9
commit
00864c63e8
@ -144,4 +144,5 @@ Master Branch
|
|||||||
|
|
||||||
- [Export list] improve alignment of last line
|
- [Export list] improve alignment of last line
|
||||||
- [CRUD] Forward query parameters when pushing button "save and new" in "create" page;
|
- [CRUD] Forward query parameters when pushing button "save and new" in "create" page;
|
||||||
|
- [Show/hide] Take selects input into account;
|
||||||
|
|
||||||
|
@ -43,7 +43,10 @@ var ShowHide = function(options) {
|
|||||||
|
|
||||||
// attach the listener on each input
|
// attach the listener on each input
|
||||||
for (let f of froms.values()) {
|
for (let f of froms.values()) {
|
||||||
let inputs = f.querySelectorAll('input');
|
let
|
||||||
|
inputs = f.querySelectorAll('input'),
|
||||||
|
selects = f.querySelectorAll('select');
|
||||||
|
|
||||||
for (let input of inputs.values()) {
|
for (let input of inputs.values()) {
|
||||||
if (debug) {
|
if (debug) {
|
||||||
console.log('attaching event to input', input);
|
console.log('attaching event to input', input);
|
||||||
@ -52,6 +55,14 @@ var ShowHide = function(options) {
|
|||||||
onChange(e);
|
onChange(e);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
for (let input of selects.values()) {
|
||||||
|
if (debug) {
|
||||||
|
console.log('attaching event to selects', input);
|
||||||
|
}
|
||||||
|
input.addEventListener(event_name, function(e) {
|
||||||
|
onChange(e);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// first launch of the show/hide
|
// first launch of the show/hide
|
||||||
|
Loading…
x
Reference in New Issue
Block a user