Skip to content

Commit

Permalink
added add all option
Browse files Browse the repository at this point in the history
  • Loading branch information
perminder-klair committed Feb 17, 2015
1 parent 5f83f52 commit a73c5ed
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 27 deletions.
1 change: 0 additions & 1 deletion Gruntfile.js
Expand Up @@ -29,7 +29,6 @@ module.exports = function (grunt) {
'src/18-directive-playAll.js',
'src/19-directive-volumeBar.js',
'src/20-directive-playPauseToggle.js',
'src/21-directive-addAll.js',
],
dest: 'dist/angular-soundmanager2.js'
}
Expand Down
3 changes: 3 additions & 0 deletions dist/angular-soundmanager2.js
Expand Up @@ -5090,8 +5090,11 @@ ngSoundManager.directive('playAll', ['angularPlayer', '$log',
for(var i = 0; i < scope.songs.length; i++) {
angularPlayer.addTrack(scope.songs[i]);
}

if (attrs.play != 'false') {
//play first song
angularPlayer.play();
}
});
});
}
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-soundmanager2.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/index.html
Expand Up @@ -21,6 +21,7 @@ <h5>Songs</h5>
</ul>

<button play-all="songs">Play all</button>
<button play-all="songs" data-play="false">Add all</button>

</div>
</div>
Expand Down
7 changes: 5 additions & 2 deletions src/18-directive-playAll.js
Expand Up @@ -14,8 +14,11 @@ ngSoundManager.directive('playAll', ['angularPlayer', '$log',
for(var i = 0; i < scope.songs.length; i++) {
angularPlayer.addTrack(scope.songs[i]);
}
//play first song
angularPlayer.play();

if (attrs.play != 'false') {
//play first song
angularPlayer.play();
}
});
});
}
Expand Down
22 changes: 0 additions & 22 deletions src/21-directive-addAll.js

This file was deleted.

1 comment on commit a73c5ed

@denitto
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to suggest possibly removing angularPlayer.clearPlaylist(function(data) or having a value to trigger it? quickfix!

Please sign in to comment.