Fixing joining JS code.
This commit is contained in:
@@ -61,15 +61,19 @@ var LeagueResultsUI = Class.extend({
|
|||||||
$("#leagueResults").append("<div class='leagueMembership'>You are already a member of this league.</div>");
|
$("#leagueResults").append("<div class='leagueMembership'>You are already a member of this league.</div>");
|
||||||
else if (joinable == "true") {
|
else if (joinable == "true") {
|
||||||
var joinBut = $("<button>Join league</button>").button();
|
var joinBut = $("<button>Join league</button>").button();
|
||||||
joinBut.click(
|
|
||||||
function() {
|
var joinFunc = (function(leagueCode, costString) {
|
||||||
that.displayBuyAction("Do you want to join the league by paying " + costStr + "?",
|
return function() {
|
||||||
function() {
|
that.displayBuyAction("Do you want to join the league by paying " + costString + "?",
|
||||||
that.communication.joinLeague(leagueType, function() {
|
function() {
|
||||||
that.loadResults();
|
that.communication.joinLeague(leagueCode, function() {
|
||||||
});
|
that.loadResults();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
})(leagueType, costStr);
|
||||||
|
|
||||||
|
joinBut.click(joinFunc);
|
||||||
var joinDiv = $("<div class='leagueMembership'>You're not a member of this league. </div>");
|
var joinDiv = $("<div class='leagueMembership'>You're not a member of this league. </div>");
|
||||||
joinDiv.append(joinBut);
|
joinDiv.append(joinBut);
|
||||||
$("#leagueResults").append(joinDiv);
|
$("#leagueResults").append(joinDiv);
|
||||||
|
|||||||
Reference in New Issue
Block a user