From b3a2f32b8f8c7e8fcad6850aa9a31a68721e4c99 Mon Sep 17 00:00:00 2001 From: Nightprince Date: Tue, 27 Aug 2024 06:48:54 +0330 Subject: [PATCH] Module/LevelUp: Fix show correct characters list if theme have not custom select --- application/modules/levelup/js/levelup.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/application/modules/levelup/js/levelup.js b/application/modules/levelup/js/levelup.js index 1b4ba7f14..16c90fde7 100644 --- a/application/modules/levelup/js/levelup.js +++ b/application/modules/levelup/js/levelup.js @@ -15,9 +15,25 @@ const LevelUp = { const realmId = $('select[id="realm"]').val(); $(`[data-character]`).each(function() { - $(this).next().hide(); + const nextElement = $(this).next(); + const parentElement = $(this).parent(); + if (nextElement.hasClass('sbHolder')) { + nextElement.hide(); + } else if (parentElement.hasClass('selectboxit-container')) { + parentElement.hide(); + } else { + $(this).hide(); + } }); - $(`select[id="character_select_${realmId}"]`).next().show(); + + const selectedElement = $(`select[id="character_select_${realmId}"]`); + + const nextSelectedElement = selectedElement.next(); + if (nextSelectedElement.hasClass('sbHolder') || nextSelectedElement.hasClass('selectboxit-container')) { + nextSelectedElement.show(); + } else { + selectedElement.show(); + } this.User.realm = realmId; },