Fix undefined error when some dropdowns aren't shown in the images index view (#9211)

Fixes #9210
pull/9235/head
Tidiane Dia 2022-09-16 12:12:35 +01:00 zatwierdzone przez Matt Westcott
rodzic cee4bb8880
commit 4447333160
3 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -53,6 +53,7 @@ Changelog
* Fix: Update alignment and reveal logic of fields comment buttons (Steven Steinwand)
* Fix: Regression from Markdown conversion in documentation for API configuration - update to correctly use PEP-8 for example code (Storm Heg)
* Fix: Prevent 'Delete' link on page edit view from redirecting back to the deleted page (LB (Ben) Johnston)
* Fix: Prevent JS error on images index view when collections dropdown is omitted (Tidiane Dia)
4.0.1 (05.09.2022)

Wyświetl plik

@ -28,3 +28,4 @@ depth: 1
* Update alignment and reveal logic of fields comment buttons (Steven Steinwand)
* Regression from Markdown conversion in documentation for API configuration - update to correctly use PEP-8 for example code (Storm Heg)
* Prevent 'Delete' link on page edit view from redirecting back to the deleted page (LB (Ben) Johnston)
* Prevent JS error on images index view when collections dropdown is omitted (Tidiane Dia)

Wyświetl plik

@ -15,9 +15,9 @@
const submitFormOnDropdownChange = (dropdownSelector) => {
const dropdown = document.querySelector(dropdownSelector);
dropdown.addEventListener('change', () => {
dropdown.form.submit();
})
if (dropdown !== null) {
dropdown.addEventListener('change', () => dropdown.form.submit());
}
};
const dropdownSelectors = [
"#collection_chooser_collection_id",