Skip to content

Commit 91c53a3

Browse files
Merge pull request #103 from NenoR96/playlistToast
enhancement: added toast message to add/remove actions from playlist
2 parents 1c286b5 + bb6f9d9 commit 91c53a3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

widget/controllers/widget.nowplaying.controller.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@
154154
audioPlayer.settings.set(NowPlaying.settings);
155155
};
156156
NowPlaying.addToPlaylist = function (track) {
157-
if (track) audioPlayer.addToPlaylist(track);
157+
if (track) {
158+
audioPlayer.addToPlaylist(track);
159+
buildfire.components.toast.showToastMessage({text: "Added to playlist"}, console.log);
160+
}
158161
};
159162
NowPlaying.removeFromPlaylist = function (track) {
160163
if (NowPlaying.playList) {
@@ -163,9 +166,11 @@
163166
return index;
164167
});
165168
}
169+
buildfire.components.toast.showToastMessage({text: "Removed from playlist"}, console.log);
166170
};
167171
NowPlaying.removeTrackFromPlayList = function (index) {
168172
audioPlayer.removeFromPlaylist(index);
173+
buildfire.components.toast.showToastMessage({text: "Removed from playlist"}, console.log);
169174
};
170175
NowPlaying.getFromPlaylist = function () {
171176
audioPlayer.getPlaylist(function (err, data) {

widget/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<script src="../../../scripts/angular/angular-animate.min.js"></script>
3737
<script src="../../../scripts/angular/angular-touch.js"></script>
3838
<script src="../../../scripts/buildfire/services/fileSystem/fileManager.js"></script>
39+
<script src="../../../scripts/buildfire/components/toast/toast.js"></script>
3940

4041

4142
<!-- build:bundleJSFiles -->

0 commit comments

Comments
 (0)