Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions build/media/com_menus/js/admin-item-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,21 @@
var data = JSON.parse(response);
var list = document.querySelectorAll('#jform_parent_id option');
list.forEach(function (item) {
if (item != '1') {
if (item.value !== '1') {
item.remove();
}
});

data.forEach(function (val) {
var option = document.createElement('option');
option.innerText = value;
option.innerText = val.title;
option.id = val.id;
document.getElementById('jform_parent_id').appendChild(option);
});
document.getElementById('jform_parent_id').trigger('change');

var event = document.createEvent('HTMLEvents');
event.initEvent('change', true, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To normalize, would be good to indent with tabs for the 2 above lines instead of spaces

document.getElementById('jform_parent_id').dispatchEvent(event);
},
onError : function (xhr) {
Joomla.renderMessages(Joomla.ajaxErrorsMessages(xhr));
Expand Down