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.

22 lines
565 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. $(sel+".team-icon").removeClass("hidden");
  6. if(e.complete) {
  7. $(sel+".team-icon").removeClass("empty");
  8. } else {
  9. $(sel+".team-icon").addClass("empty");
  10. }
  11. $("[data-team="+e.team_slug+"] .total.score b").text(e.team_score);
  12. console.log(e);
  13. });
  14. setTimeout(function(){
  15. window.location.reload();
  16. }, 300*1000);