Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2305)

Unified Diff: chrome/browser/resources/file_manager/audio_player/elements/track_list.js

Issue 165983002: [AudioPlayer] Regenerate play order when is is insufficient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adressed the comment Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/audio_player/js/audio_player.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/audio_player/elements/track_list.js
diff --git a/chrome/browser/resources/file_manager/audio_player/elements/track_list.js b/chrome/browser/resources/file_manager/audio_player/elements/track_list.js
index f022870aa4d750ccf17895a72e1019893fed9803..0f37b2512f86797ad329302e429f73851c696ca1 100644
--- a/chrome/browser/resources/file_manager/audio_player/elements/track_list.js
+++ b/chrome/browser/resources/file_manager/audio_player/elements/track_list.js
@@ -101,17 +101,18 @@
* @param {Event} event Click event.
*/
tracksChanged: function(oldValue, newValue) {
- if (oldValue !== newValue) {
- // Re-register the observer of 'this.tracks'.
- this.tracksObserver_.close();
- this.tracksObserver_ = new ArrayObserver(
- this.tracks,
- this.tracksValueChanged_.bind(this));
-
- // Reset play order and current index.
- if (this.tracks.length !== 0)
- this.generatePlayOrder(false /* no need to keep the current track */);
- }
+ // Note: Sometimes both oldValue and newValue are null though the actual
+ // values are not null. Maybe it's a bug of Polymer.
+
+ // Re-register the observer of 'this.tracks'.
+ this.tracksObserver_.close();
+ this.tracksObserver_ = new ArrayObserver(
+ this.tracks,
+ this.tracksValueChanged_.bind(this));
+
+ // Reset play order and current index.
+ if (this.tracks.length !== 0)
+ this.generatePlayOrder(false /* no need to keep the current track */);
if (this.tracks.length === 0) {
this.playOrder = [];
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/audio_player/js/audio_player.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698