ily.li/assets/js/fm.js

17 lines
679 B
JavaScript
Raw Normal View History

2020-06-14 15:05:04 +02:00
document.addEventListener('DOMContentLoaded', () => {
2020-06-14 21:23:57 +02:00
if (!document.getElementById('upload-form')) return;
2020-06-14 15:05:04 +02:00
const neverExpireCheckbox = document.getElementById('field-never_expire');
const expireAfterDaysField = document.getElementById('field-expire_after_days');
2020-06-14 21:23:57 +02:00
const autogenUrlCheckbox = document.getElementById('field-autogen_url');
const slugField = document.getElementById('field-slug');
2020-06-14 15:05:04 +02:00
neverExpireCheckbox.addEventListener('change', () => {
2020-06-14 21:23:57 +02:00
expireAfterDaysField.disabled = neverExpireCheckbox.checked;
});
autogenUrlCheckbox.addEventListener('change', () => {
slugField.disabled = autogenUrlCheckbox.checked;
2020-06-14 15:05:04 +02:00
});
});