ily.li/assets/js/url-shortener.js

12 lines
408 B
JavaScript
Raw Normal View History

2020-07-06 10:49:18 +02:00
document.addEventListener('DOMContentLoaded', () => {
const form = document.getElementById('url-shortener-form');
if (!form) return;
const autogenUrlCheckbox = document.getElementById('field-autogen_url');
const slugField = document.getElementById('field-slug');
autogenUrlCheckbox.addEventListener('change', () => {
slugField.disabled = autogenUrlCheckbox.checked;
});
});