Upstream version 7.35.139.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / resources / file_manager / audio_player / elements / track_list.js
index 03445f1..2f6cf86 100644 (file)
           break;
         }
       }
-      if (index >= 0)
-        this.currentTrackIndex = index;
+      if (index >= 0) {
+        // TODO(yoshiki): Clean up the flow and the code around here.
+        if (this.currentTrackIndex == index)
+          this.replayCurrentTrack();
+        else
+          this.currentTrackIndex = index;
+      }
+    },
+
+    /**
+     * Request to replay the current music.
+     */
+    replayCurrentTrack: function() {
+      this.fire('replay');
     },
 
     /**