diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/leagueResultsUi.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/leagueResultsUi.js index acc0b20b1..2541527d2 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/leagueResultsUi.js +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/leagueResultsUi.js @@ -61,15 +61,19 @@ var LeagueResultsUI = Class.extend({ $("#leagueResults").append("
You are already a member of this league.
"); else if (joinable == "true") { var joinBut = $("").button(); - joinBut.click( - function() { - that.displayBuyAction("Do you want to join the league by paying " + costStr + "?", - function() { - that.communication.joinLeague(leagueType, function() { - that.loadResults(); - }); + + var joinFunc = (function(leagueCode, costString) { + return function() { + that.displayBuyAction("Do you want to join the league by paying " + costString + "?", + function() { + that.communication.joinLeague(leagueCode, function() { + that.loadResults(); }); - }); + }); + }; + })(leagueType, costStr); + + joinBut.click(joinFunc); var joinDiv = $("
You're not a member of this league.
"); joinDiv.append(joinBut); $("#leagueResults").append(joinDiv);