Skip to content

Commit 8b8346b

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

File tree

4 files changed

+18
-26
lines changed

4 files changed

+18
-26
lines changed

media/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

media/com_associations/js/associations-edit.es6.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

media/com_associations/js/associations-edit.js

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

3232
Joomla.showAssociationMessage = function () {
3333
var controlGroup = [].slice.call(document.querySelectorAll('#associations .control-group'));
34+
var associations = document.getElementById('associations');
3435

35-
controlGroup.forEach(function (element) {
36-
element.style.display = 'none';
36+
if (associations) {
37+
var html = document.createElement('joomla-alert');
38+
html.innerHTML = Joomla.JText._('JGLOBAL_ASSOC_NOT_POSSIBLE');
3739

38-
var associations = document.getElementById('associations');
39-
40-
if (associations) {
41-
var html = document.createElement('div');
42-
html.classList.add('alert');
43-
html.classList.add('alert-info');
44-
html.id = 'associations-notice';
45-
html.innerHTML = Joomla.JText._('JGLOBAL_ASSOC_NOT_POSSIBLE');
40+
associations.insertAdjacentElement('afterbegin', html);
41+
}
4642

47-
associations.insertAdjacentElement('afterbegin', html);
48-
}
43+
controlGroup.forEach(function (element) {
44+
element.style.display = 'none';
4945
});
5046
};
5147

media/com_associations/js/associations-edit.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)