Last active
December 21, 2015 11:49
-
-
Save alejandroiglesias/6301571 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$rootScope.$on('auction:finished', function (event, auction) { | |
// If current user won, show win modal. | |
if (auction.winner.facebookId !== $scope.user.facebookId) { | |
return; | |
} | |
$scope.wonAuction = auction; | |
// If playing for tokens, update user tokens. | |
if (auction.bidType !== $scope.AUCTION_TYPE_TOKENS) { | |
return; | |
} | |
$rootScope.user.tokens += Number(auction.retailPrice); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dialog ng-show="wonAuction" ng-class="{'item-decoration': wonAuction.bidType == AUCTION_TYPE_CREDITS}" dialog-title="Item won!" dialog-close="Continue bidding!" dialog-close-class="'btn-green'"> | |
<p class="winner">Congratulations <span class="winner-name">{% templatetag openvariable %}user.displayName{% templatetag closevariable %}</span> <span class="item-name">You won {% templatetag openvariable %}wonAuction.itemName{% templatetag closevariable %}!</span></p> | |
<div class="item"> | |
<img ng-src="{% templatetag openvariable %}wonAuction.itemImage{% templatetag closevariable %}"> | |
</div> | |
<p class="info text-small-w">Check your e-mail, you will receive an email with<br>all the details you need to get your prize.</p> | |
</dialog> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment