mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-18 13:39:57 -04:00
Remove basic view setting and preview
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
(function(Modules) {
|
||||
"use strict";
|
||||
|
||||
Modules.ConditionalRadios = function() {
|
||||
|
||||
this.start = function(component) {
|
||||
|
||||
const $radios = $('[type=radio]', $(component)),
|
||||
$checkboxes = $('[type=checkbox]', $(component));
|
||||
|
||||
let clearable = true;
|
||||
|
||||
let clearInvalidSelections = function() {
|
||||
if (!clearable) {
|
||||
clearable = true;
|
||||
return;
|
||||
}
|
||||
$radios.each(function() {
|
||||
let checked = $(this).is(':checked');
|
||||
$('#panel-' + $(this).attr('value'))
|
||||
.each(function() {
|
||||
if (!checked) {
|
||||
$('[type=checkbox]', this).removeAttr('checked');
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
let selectParent = function() {
|
||||
clearable = false;
|
||||
let parentValue = $(this).parents("[id^='panel-']").attr('id').replace('panel-', '');
|
||||
$('[value=' + parentValue + ']').trigger('click');
|
||||
};
|
||||
|
||||
$checkboxes.on('click', selectParent);
|
||||
$radios.on('click', clearInvalidSelections);
|
||||
clearInvalidSelections();
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
})(window.GOVUK.Modules);
|
||||
Reference in New Issue
Block a user