mirror of
https://github.com/daniviga/django-ram.git
synced 2025-12-26 15:28:31 +01:00
* Initial work to support magazines * Change editor default height to 300px from 500px * Stabilize the magazine repository app * Switch from stacked to tabular inlines for magazines * Update submodules
17 lines
562 B
JavaScript
17 lines
562 B
JavaScript
document.addEventListener('formset:added', function(event) {
|
|
const newForm = event.target; // the new inline form element
|
|
|
|
const defaultLanguage = document.querySelector('#id_language').value;
|
|
const defaultStatus = document.querySelector('#id_published').checked;
|
|
|
|
const languageInput = newForm.querySelector('select[name$="language"]');
|
|
const statusInput = newForm.querySelector('input[name$="published"]');
|
|
|
|
if (languageInput) {
|
|
languageInput.value = defaultLanguage;
|
|
}
|
|
if (statusInput) {
|
|
statusInput.checked = defaultStatus;
|
|
}
|
|
});
|