Skip to content

Commit

Permalink
Module/LevelUp: Fix show correct characters list if theme have not cu…
Browse files Browse the repository at this point in the history
…stom select
  • Loading branch information
Nightprince committed Aug 27, 2024
1 parent 11f3626 commit b3a2f32
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions application/modules/levelup/js/levelup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down

0 comments on commit b3a2f32

Please sign in to comment.