Skip to content

Commit dc9f0f8

Browse files
committed
[4.0] Fix: Associations tab should display only one Notice when item
edited is set to ALL languages
1 parent eead512 commit dc9f0f8

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

build/media_src/com_associations/js/associations-edit.es6.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,17 @@ Joomla = window.Joomla || {};
2626

2727
Joomla.showAssociationMessage = () => {
2828
const controlGroup = [].slice.call(document.querySelectorAll('#associations .control-group'));
29+
const associations = document.getElementById('associations');
2930

30-
controlGroup.forEach((element) => {
31-
element.style.display = 'none';
31+
if (associations) {
32+
const html = document.createElement('joomla-alert');
33+
html.innerHTML = Joomla.JText._('JGLOBAL_ASSOC_NOT_POSSIBLE');
3234

33-
const associations = document.getElementById('associations');
34-
35-
if (associations) {
36-
const html = document.createElement('div');
37-
html.classList.add('alert');
38-
html.classList.add('alert-info');
39-
html.id = 'associations-notice';
40-
html.innerHTML = Joomla.JText._('JGLOBAL_ASSOC_NOT_POSSIBLE');
35+
associations.insertAdjacentElement('afterbegin', html);
36+
}
4137

42-
associations.insertAdjacentElement('afterbegin', html);
43-
}
38+
controlGroup.forEach((element) => {
39+
element.style.display = 'none';
4440
});
4541
};
4642

0 commit comments

Comments
 (0)