mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
sharing: Drop jQuery code as the library dependency has been removed
Tests: - Enabling/disabling public share shows and hides the list of groups in share edit page. - When loading the share page, if public share is enabled, list of groups is hidden. - When loading the share page, if public share is disabled, list of groups is shown. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
5fc48e684b
commit
79482f7a38
@ -22,16 +22,19 @@
|
||||
* in this page.
|
||||
*/
|
||||
|
||||
var sharing_groups = $('#id_sharing-groups').parent().parent();
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const sharingGroups = document.getElementById('id_sharing-groups').closest('.form-group');
|
||||
const isPublic = document.getElementById('id_sharing-is_public');
|
||||
|
||||
if ($("#id_sharing-is_public").prop('checked')) {
|
||||
sharing_groups.hide();
|
||||
}
|
||||
|
||||
$("#id_sharing-is_public").change(function() {
|
||||
if (this.checked) {
|
||||
sharing_groups.hide();
|
||||
} else {
|
||||
sharing_groups.show();
|
||||
if (isPublic.checked) {
|
||||
sharingGroups.style.display = 'none';
|
||||
}
|
||||
|
||||
isPublic.addEventListener('change', (event) => {
|
||||
if (event.currentTarget.checked) {
|
||||
sharingGroups.style.display = 'none';
|
||||
} else {
|
||||
sharingGroups.style.display = '';
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user