From 02b2af7d51e59c0fe2b08bfc36a9500490160ec5 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 20 Jan 2022 17:12:18 +0100 Subject: [PATCH] attempt to make show hide work --- .../Resources/public/lib/show_hide/show_hide.js | 1 + .../Resources/public/page/person_resource/index.js | 14 ++++---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/show_hide/show_hide.js b/src/Bundle/ChillMainBundle/Resources/public/lib/show_hide/show_hide.js index ec6b796ec..edda5a03d 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/show_hide/show_hide.js +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/show_hide/show_hide.js @@ -39,6 +39,7 @@ var ShowHide = function(options) { contents.push(el); } container_content.push(contents); + console.log('container content', container_content); } // attach the listener on each input diff --git a/src/Bundle/ChillPersonBundle/Resources/public/page/person_resource/index.js b/src/Bundle/ChillPersonBundle/Resources/public/page/person_resource/index.js index 8ef2021f1..b7007dd2b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/page/person_resource/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/page/person_resource/index.js @@ -7,7 +7,6 @@ window.addEventListener('DOMContentLoaded', function() { thirdpartyContainer = document.querySelector('#thirdparty-entity'), freetextContainer = document.querySelector('#freetext-entity') ; - if (null === linkedEntityContainer) { return; } @@ -17,17 +16,12 @@ window.addEventListener('DOMContentLoaded', function() { load_event: null, froms: [linkedEntityContainer], container: [personContainer, thirdpartyContainer, freetextContainer], - test: function(containers, arg2, arg3) { - for (let container of containers) { - for (let input of container.querySelectorAll('input')) { - if (!input.checked) { - return true; - } else { - return false; - } - } + test: function(froms, event) { + if (event) { + console.log(event); } + return true; }, }) });