From 82dd6852b45c93bcea68d98204eee0884e5cd72f Mon Sep 17 00:00:00 2001 From: alexandre-pereira Date: Fri, 20 Mar 2015 19:22:13 +0100 Subject: [PATCH] x x --- SRC/resources/views/frontend/puzzle.blade.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/SRC/resources/views/frontend/puzzle.blade.php b/SRC/resources/views/frontend/puzzle.blade.php index d826d94..39afd99 100755 --- a/SRC/resources/views/frontend/puzzle.blade.php +++ b/SRC/resources/views/frontend/puzzle.blade.php @@ -179,10 +179,16 @@ trophee.height = 270; trophee.alpha = 0; tween = game.add.tween(trophee).to( { alpha: 1 }, 1000).start(); - setTimeout(function(){ - location.href ="{{URL::to('setRecords')}}" + "/" + trophy; - location.href = "{{URL::to('puzzle/jouer')}}" + "/" + trophy; - }, 5000); + var r = new XMLHttpRequest(); + r.open("GET", "{{URL::to('setRecords')}}", true); + r.onreadystatechange = function () { + if (r.readyState != 4 || r.status != 200) return; + setTimeout(function(){ + location.href = "{{URL::to('puzzle/jouer')}}" + "/" + trophy; + }, 3000); + }; + r.send(); + // TODO appel ajax //var t1 = game.world.create(game.world.centerX,game.world.centerY, "tableau1"); //t1.anchor.setTo(0.5,0.5);