-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathcontent.edit.js
More file actions
28 lines (25 loc) · 875 Bytes
/
content.edit.js
File metadata and controls
28 lines (25 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
(function (global, doc) {
const editButtons = doc.querySelectorAll('.ibexa-btn--edit');
editButtons.forEach((editButton) => {
const languageRadioOption = doc.querySelector(
`.ibexa-extra-actions--edit.ibexa-extra-actions--prevent-show[data-actions="${editButton.dataset.actions}"] .ids-input--radio`,
);
if (!languageRadioOption) {
return;
}
editButton.addEventListener(
'click',
() => {
languageRadioOption.checked = true;
languageRadioOption.dispatchEvent(
new CustomEvent('change', {
detail: {
sendImmediately: true,
},
}),
);
},
false,
);
});
})(window, window.document);