Bladeren bron

Anomalie #749: Pas de lecture auto quand affichage de nouveaux élements

Sevajol Bastien 11 jaren geleden
bovenliggende
commit
9dcf938e21

+ 3 - 1
src/Muzich/CoreBundle/Controller/ElementController.php Bestand weergeven

@@ -396,7 +396,9 @@ class ElementController extends Controller
396 396
     // On en fait un rendu graphique
397 397
     $html_elements = $this->render('MuzichCoreBundle:SearchElement:default.html.twig', array(
398 398
       'user'        => $this->getUser(),
399
-      'elements'    => $elements
399
+      'elements'    => $elements,
400
+      'display_autoplay' => true,
401
+      'autoplay_context' => 'home'
400 402
     ))->getContent();
401 403
     
402 404
     // On calcule le nouveau compte de nouveaux

+ 5 - 2
src/Muzich/CoreBundle/Resources/public/js/autoplay.js Bestand weergeven

@@ -64,8 +64,11 @@ function Autoplay()
64 64
     players = window.players_manager.getAll();
65 65
     for (var i in players)
66 66
     {
67
-      players[i].stopAndDestroy();
68
-      window.players_manager.remove(i);
67
+      if (i in players)
68
+      {
69
+        players[i].stopAndDestroy();
70
+        window.players_manager.remove(i);
71
+      }
69 72
     }
70 73
   }
71 74