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

Unified Diff: ui/file_manager/file_manager/audio_player/elements/track_list.js

Issue 571453002: Correct indentation, JSDoc, etc... to comply with closure linter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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 | ui/file_manager/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: ui/file_manager/file_manager/audio_player/elements/track_list.js
diff --git a/ui/file_manager/file_manager/audio_player/elements/track_list.js b/ui/file_manager/file_manager/audio_player/elements/track_list.js
index b9fa48c1a66810e60b25643e61c5a821b04a3349..353083d88bf56f5c53ccf59d7e12d5208c4e726d 100644
--- a/ui/file_manager/file_manager/audio_player/elements/track_list.js
+++ b/ui/file_manager/file_manager/audio_player/elements/track_list.js
@@ -197,18 +197,17 @@
if (this.model && this.model.shuffle) {
// Randomizes the play order array (Schwarzian-transform algorithm).
- this.playOrder =
- this.playOrder.
- map(function(a) {
+ this.playOrder = this.playOrder
+ .map(function(a) {
return {weight: Math.random(), index: a};
- }).
- sort(function(a, b) { return a.weight - b.weight }).
- map(function(a) { return a.index });
+ })
+ .sort(function(a, b) { return a.weight - b.weight })
+ .map(function(a) { return a.index });
if (keepCurrentTrack) {
// Puts the current track at the beginning of the play order.
- this.playOrder =
- this.playOrder.filter(function(value) {
+ this.playOrder = this.playOrder
+ .filter(function(value) {
return this.currentTrackIndex !== value;
}, this);
this.playOrder.splice(0, 0, this.currentTrackIndex);
@@ -281,7 +280,7 @@
console.assert(
(0 <= currentPlayOrder && currentPlayOrder < this.tracks.length),
'Insufficient TrackList.playOrder. The current track is not on the ' +
- 'track list.');
+ 'track list.');
var newPlayOrder = currentPlayOrder + (forward ? +1 : -1);
if (newPlayOrder === -1 || newPlayOrder === this.tracks.length)
« no previous file with comments | « no previous file | ui/file_manager/file_manager/audio_player/js/audio_player.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698