Commit da249e94 authored by Bengfort's avatar Bengfort
Browse files

fixup

parent 1f676dbc
Pipeline #6439 passed with stages
in 7 minutes and 13 seconds
......@@ -24,7 +24,9 @@
var checked = document.querySelector('[name="exclusion_criteria_checked"]');
var needsCheck = checked && !checked.checked;
invited.disabled = needsCheck;
alert.hidden = !needsCheck;
if (alert) {
alert.hidden = !needsCheck;
}
};
$$.on(document, 'change', '[name="exclusion_criteria_checked"]', setInvitedDisabled);
......
......@@ -45,16 +45,16 @@
});
$$.on(document, 'click', '[data-multi-reset]', function() {
var targetId = this.dataset.multiReset;
var target = document.getElementById(targetId);
var targetSelector = this.dataset.multiReset;
var target = document.querySelector(targetSelector);
target.querySelectorAll('option').forEach(function(element) {
element.selected = false;
});
});
$$.on(document, 'click', '[data-clipboard]', function() {
var targetId = this.dataset.clipboard;
var target = document.getElementById(targetId);
var targetSelector = this.dataset.clipboard;
var target = document.querySelector(targetSelector);
if (navigator.clipboard) {
navigator.clipboard.writeText(target.value);
} else {
......
......@@ -16,7 +16,10 @@
fieldset.querySelector('[name="form-' + index + '-name"]').remove();
fieldset.querySelector('[name="form-' + index + '-duration"]').remove();
fieldset.querySelector('[name="form-' + index + '-resource"]').remove();
var resourceInput = fieldset.querySelector('[name="form-' + index + '-resource"]');
if (resourceInput) {
resourceInput.remove();
}
var hidden = document.createElement('input');
hidden.type = 'hidden';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment