diff --git a/javascript/commons/BattleRoyale.js b/javascript/commons/BattleRoyale.js index 3889521081e..7d599b998f0 100644 --- a/javascript/commons/BattleRoyale.js +++ b/javascript/commons/BattleRoyale.js @@ -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 ); @@ -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();