Browse Source

Evolution #119: Mise en Favoris: etoile jaune tout de suite

bastien 13 years ago
parent
commit
8a66e2d461
1 changed files with 12 additions and 0 deletions
  1. 12 0
      web/bundles/muzichcore/js/muzich.js

+ 12 - 0
web/bundles/muzichcore/js/muzich.js View File

@@ -382,6 +382,18 @@ $(document).ready(function(){
382 382
   // Mise en favoris
383 383
   $('a.favorite_link').live("click", function(){
384 384
     link = $(this);
385
+    
386
+    // Pour ne pas attendre la fin du chargement ajax:
387
+    img = link.find('img');
388
+    if (img.attr('src') == '/bundles/muzichcore/img/favorite_bw.png')
389
+    {
390
+      img.attr('src', '/bundles/muzichcore/img/favorite.png');
391
+    }
392
+    else
393
+    {
394
+        img.attr('src', '/bundles/muzichcore/img/favorite_bw.png');
395
+    }
396
+    
385 397
     $.getJSON($(this).attr('href'), function(response) {
386 398
       if (response.status == 'mustbeconnected')
387 399
       {