From 46c582ac96ba25d43bb39a057be0bc1309747601 Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Thu, 2 Aug 2018 15:24:06 +0200 Subject: [PATCH 1/3] [4.0] Fix: Associations tab should display only one Notice when item edited is set to ALL languages --- .../js/associations-edit.es6.js | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/build/media_src/com_associations/js/associations-edit.es6.js b/build/media_src/com_associations/js/associations-edit.es6.js index 3fa7e60707abb..7b0cab5df7b8a 100644 --- a/build/media_src/com_associations/js/associations-edit.es6.js +++ b/build/media_src/com_associations/js/associations-edit.es6.js @@ -26,21 +26,17 @@ Joomla = window.Joomla || {}; Joomla.showAssociationMessage = () => { const controlGroup = [].slice.call(document.querySelectorAll('#associations .control-group')); + const associations = document.getElementById('associations'); - controlGroup.forEach((element) => { - element.style.display = 'none'; + if (associations) { + const html = document.createElement('joomla-alert'); + html.innerHTML = Joomla.JText._('JGLOBAL_ASSOC_NOT_POSSIBLE'); - const associations = document.getElementById('associations'); - - if (associations) { - const html = document.createElement('div'); - html.classList.add('alert'); - html.classList.add('alert-info'); - html.id = 'associations-notice'; - html.innerHTML = Joomla.JText._('JGLOBAL_ASSOC_NOT_POSSIBLE'); + associations.insertAdjacentElement('afterbegin', html); + } - associations.insertAdjacentElement('afterbegin', html); - } + controlGroup.forEach((element) => { + element.style.display = 'none'; }); }; From eead512e301d95a2810b95ba8022e2e7fe8c49fb Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Thu, 2 Aug 2018 15:39:17 +0200 Subject: [PATCH 2/3] correcting my local branch --- .../js/associations-edit.es6.js | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/build/media_src/com_associations/js/associations-edit.es6.js b/build/media_src/com_associations/js/associations-edit.es6.js index 7b0cab5df7b8a..3fa7e60707abb 100644 --- a/build/media_src/com_associations/js/associations-edit.es6.js +++ b/build/media_src/com_associations/js/associations-edit.es6.js @@ -26,17 +26,21 @@ Joomla = window.Joomla || {}; Joomla.showAssociationMessage = () => { const controlGroup = [].slice.call(document.querySelectorAll('#associations .control-group')); - const associations = document.getElementById('associations'); - - if (associations) { - const html = document.createElement('joomla-alert'); - html.innerHTML = Joomla.JText._('JGLOBAL_ASSOC_NOT_POSSIBLE'); - - associations.insertAdjacentElement('afterbegin', html); - } controlGroup.forEach((element) => { element.style.display = 'none'; + + const associations = document.getElementById('associations'); + + if (associations) { + const html = document.createElement('div'); + html.classList.add('alert'); + html.classList.add('alert-info'); + html.id = 'associations-notice'; + html.innerHTML = Joomla.JText._('JGLOBAL_ASSOC_NOT_POSSIBLE'); + + associations.insertAdjacentElement('afterbegin', html); + } }); }; From dc9f0f8c4a95cc4b178325f5881ab224728718b0 Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Thu, 2 Aug 2018 15:46:17 +0200 Subject: [PATCH 3/3] [4.0] Fix: Associations tab should display only one Notice when item edited is set to ALL languages --- .../js/associations-edit.es6.js | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/build/media_src/com_associations/js/associations-edit.es6.js b/build/media_src/com_associations/js/associations-edit.es6.js index 3fa7e60707abb..7b0cab5df7b8a 100644 --- a/build/media_src/com_associations/js/associations-edit.es6.js +++ b/build/media_src/com_associations/js/associations-edit.es6.js @@ -26,21 +26,17 @@ Joomla = window.Joomla || {}; Joomla.showAssociationMessage = () => { const controlGroup = [].slice.call(document.querySelectorAll('#associations .control-group')); + const associations = document.getElementById('associations'); - controlGroup.forEach((element) => { - element.style.display = 'none'; + if (associations) { + const html = document.createElement('joomla-alert'); + html.innerHTML = Joomla.JText._('JGLOBAL_ASSOC_NOT_POSSIBLE'); - const associations = document.getElementById('associations'); - - if (associations) { - const html = document.createElement('div'); - html.classList.add('alert'); - html.classList.add('alert-info'); - html.id = 'associations-notice'; - html.innerHTML = Joomla.JText._('JGLOBAL_ASSOC_NOT_POSSIBLE'); + associations.insertAdjacentElement('afterbegin', html); + } - associations.insertAdjacentElement('afterbegin', html); - } + controlGroup.forEach((element) => { + element.style.display = 'none'; }); };