Skip to content

Commit

Permalink
fix(match2): BattleRoyale loading panels in wrong container when ther…
Browse files Browse the repository at this point in the history
…e's multiple (#5147)

* change queryselectors

* lint
  • Loading branch information
liquidely authored Nov 27, 2024
1 parent 2ea07df commit e0cbaf3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions javascript/commons/BattleRoyale.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,11 @@ liquipedia.battleRoyale = {

if ( loadTemplate && !this.loadedTabs[ battleRoyaleId ][ matchContentId ] ) {
this.callTemplate( battleRoyaleId, matchId, gameId, matchContentId, () => {
this.buildBattleRoyaleMapMatchContents( battleRoyaleId, document.querySelector(
`[data-js-battle-royale-content-id="${ matchContentId }"]` ), true );
this.buildBattleRoyaleMapMatchContents(
battleRoyaleId, this.battleRoyaleInstances[ battleRoyaleId ].querySelector(
`[data-js-battle-royale-content-id="${ matchContentId }"]`
), true
);
this.loadedTabs[ battleRoyaleId ][ matchContentId ] = true;
this.updateGameTabDisplay( battleRoyaleId, matchContentId, gameTab );
this.makeCollapsibles( battleRoyaleId );
Expand Down Expand Up @@ -371,7 +374,10 @@ liquipedia.battleRoyale = {
wikitext += `{{ShowSingleGame|id=${ battleRoyaleId }|matchid=${ matchId }|gameidx=${ i }}}`;
}

const element = document.querySelector( `[data-js-battle-royale-content-id="${ matchContentId }"]` );
const element =
this.battleRoyaleInstances[ battleRoyaleId ].querySelector(
`[data-js-battle-royale-content-id="${ matchContentId }"]`
);

mw.loader.using( [ 'mediawiki.api' ] ).then( () => {
const api = new mw.Api();
Expand Down

0 comments on commit e0cbaf3

Please sign in to comment.