From 0b8e8625063419ce912d78e16df3c663832ab5b3 Mon Sep 17 00:00:00 2001 From: Hector Garcia Date: Thu, 5 Nov 2015 06:30:16 +0000 Subject: [PATCH] Pass roomid when adding TeamPopup from TournamentBox --- js/client-chat-tournament.js | 2 +- js/client-mainmenu.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/js/client-chat-tournament.js b/js/client-chat-tournament.js index 780d72e2e..2f9eae9f2 100644 --- a/js/client-chat-tournament.js +++ b/js/client-chat-tournament.js @@ -763,7 +763,7 @@ }; TournamentBox.prototype.teamSelect = function (team, button) { - app.addPopup(TeamPopup, {team: team, format: this.info.format, sourceEl: button}); + app.addPopup(TeamPopup, {team: team, format: this.info.format, sourceEl: button, room: this.room.id}); }; return TournamentBox; diff --git a/js/client-mainmenu.js b/js/client-mainmenu.js index f2ce2c5cc..218b2c62a 100644 --- a/js/client-mainmenu.js +++ b/js/client-mainmenu.js @@ -892,14 +892,15 @@ } }, selectTeam: function (i) { - var formatid = this.sourceEl.closest('form').find('button[name=format]').val(); i = +i; this.sourceEl.val(i).html(TeamPopup.renderTeam(i)); if (this.sourceEl[0].offsetParent.className === 'mainmenuwrapper') { + var formatid = this.sourceEl.closest('form').find('button[name=format]').val(); app.rooms[''].curTeamIndex = i; app.rooms[''].curTeamFormat = formatid; } else if (this.sourceEl[0].offsetParent.className === 'tournament-box active') { - app.curSideRoom.tournamentBox.curTeamIndex = i; + var room = app.dispatchingPopup.options.room; + app.rooms[room].tournamentBox.curTeamIndex = i; } this.close(); }