update: add administration & circle creation
This commit is contained in:
@ -46,9 +46,9 @@ document.addEventListener('DOMContentLoaded', function (event) {
|
||||
|
||||
for(sibForm of document.querySelectorAll('[set-user-id-select]')) {
|
||||
sibForm.addEventListener('populate', () => {
|
||||
document.querySelector('sib-form[submit-button="Join Circle"]').style.display = 'none';
|
||||
if(document.querySelectorAll('sib-ac-checker:not([hidden]) > sib-delete[data-label="Leave circle"]').length == 0) {
|
||||
document.querySelector('sib-form[submit-button="Join Circle"]').style.display = 'inline-block';
|
||||
document.querySelectorAll('sib-form[submit-button^="Join"]').forEach(el=>el.style.display = 'none');
|
||||
if(document.querySelectorAll('sib-ac-checker:not([hidden]) > sib-delete[data-label="^Leave"]').length == 0) {
|
||||
document.querySelectorAll('sib-form[submit-button^="Join"]').forEach(el=>el.style.display = 'inline-block');
|
||||
}
|
||||
// BUG: Populate event trigger before the view is fully loaded! - https://git.happy-dev.fr/startinblox/framework/sib-core/issues/521
|
||||
for(select of sibForm.querySelectorAll('select[name="'+sibForm.getAttribute('set-user-id-select')+'"]')) {
|
||||
@ -58,6 +58,9 @@ document.addEventListener('DOMContentLoaded', function (event) {
|
||||
}
|
||||
});
|
||||
}
|
||||
for(leaveBtn of document.querySelectorAll('admin-circle-leave > sib-ac-checker:not([hidden])')) {
|
||||
leaveBtn.parentNode.parentNode.parentNode.nextElementSibling.style.display = "none"; // Hide Join button
|
||||
}
|
||||
}
|
||||
}).catch(error => console.log(error));
|
||||
|
||||
|
Reference in New Issue
Block a user