Skip to content

Instantly share code, notes, and snippets.

@bojan88
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bojan88/9603925 to your computer and use it in GitHub Desktop.
Save bojan88/9603925 to your computer and use it in GitHub Desktop.
Deps.autorun(function () {
if (!Session.equals("section", "race")) {
this._runing = false;
return;
}
if (this._runing) {
return;
}
this._runing = true;
var n = Session.get("race");
var length = $('#paragraph > span').length;
$('#paragraph > span').each(function (ind, el) {
Meteor.call("incrementRaceProgress", el.innerHTML, n);
if (ind === length - 1) {
Meteor.call("raceRank");
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment