Pass roomid when adding TeamPopup from TournamentBox

This commit is contained in:
Hector Garcia 2015-11-05 06:30:16 +00:00
parent f6f929efe0
commit 0b8e862506
2 changed files with 4 additions and 3 deletions

View File

@ -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;

View File

@ -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();
}