17 lines
679 B
JavaScript
17 lines
679 B
JavaScript
document.addEventListener('DOMContentLoaded', () => {
|
|
if (!document.getElementById('upload-form')) return;
|
|
|
|
const neverExpireCheckbox = document.getElementById('field-never_expire');
|
|
const expireAfterDaysField = document.getElementById('field-expire_after_days');
|
|
|
|
const autogenUrlCheckbox = document.getElementById('field-autogen_url');
|
|
const slugField = document.getElementById('field-slug');
|
|
|
|
neverExpireCheckbox.addEventListener('change', () => {
|
|
expireAfterDaysField.disabled = neverExpireCheckbox.checked;
|
|
});
|
|
|
|
autogenUrlCheckbox.addEventListener('change', () => {
|
|
slugField.disabled = autogenUrlCheckbox.checked;
|
|
});
|
|
}); |