Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$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);
});
<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
You can’t perform that action at this time.