app/packs/src/decidim/admin/choose_language.js in decidim-admin-0.26.10 vs app/packs/src/decidim/admin/choose_language.js in decidim-admin-0.27.0.rc1
- old
+ new
@@ -1,14 +1,12 @@
/* eslint-disable no-invalid-this */
-/* eslint-disable require-jsdoc */
-export default function initLanguageChangeSelect(elements) {
- elements.forEach((select) => {
- select.addEventListener("change", () => {
- let targetTabPaneSelector = select.value;
- let tabsContent = select.parentElement.parentElement.nextElementSibling;
+$(() => {
+ $("select.language-change").change(function () {
+ let $select = $(this);
+ let targetTabPaneSelector = $select.val();
+ let $tabsContent = $select.parent().parent().siblings();
- tabsContent.querySelector(".is-active").classList.remove("is-active");
- tabsContent.querySelector(targetTabPaneSelector).classList.add("is-active");
- })
- });
-}
+ $tabsContent.children(".is-active").removeClass("is-active");
+ $tabsContent.children(targetTabPaneSelector).addClass("is-active");
+ })
+});