1
0
mirror of https://github.com/danog/2048.git synced 2024-11-27 03:44:43 +01:00

move event send after type definition

This commit is contained in:
Gabriele Cirulli 2014-03-10 19:38:46 +01:00
parent a422799481
commit 57deb5d998

View File

@ -107,6 +107,8 @@ HTMLActuator.prototype.message = function (won) {
var type = won ? "game-won" : "game-over";
var message = won ? "You win!" : "Game over!"
if (ga) ga("send", "event", "game", "end", type, this.score);
this.messageContainer.classList.add(type);
this.messageContainer.getElementsByTagName("p")[0].textContent = message;
};