You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
516 B

  1. Echo.channel('score')
  2. .listen('ScoreUpdatedEvent', (e) => {
  3. var sel = "[data-team="+e.team_slug+"] [data-mission="+e.mission_slug+"]";
  4. $(sel+" .team-icon span").text(e.score);
  5. if(e.complete) {
  6. $(sel+".team-icon").removeClass("empty");
  7. } else {
  8. $(sel+".team-icon").addClass("empty");
  9. }
  10. $("[data-team="+e.team_slug+"] .total.score b").text(e.team_score);
  11. console.log(e);
  12. });
  13. setTimeout(function(){
  14. window.location.reload();
  15. }, 300*1000);