]> git.0d.be Git - panikweb.git/commitdiff
only allow a single podcast in playlist
authorFrédéric Péters <fpeters@0d.be>
Sun, 6 Aug 2017 14:09:59 +0000 (16:09 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sun, 6 Aug 2017 14:09:59 +0000 (16:09 +0200)
panikweb_templates/static/css/_specifics.scss
panikweb_templates/static/js/audioPlayer.js
panikweb_templates/static/js/specifics.js

index c9b627bd0c0101515f8a3fa177b629422c4d89f4..a15dc8d68c95c30d8c1369caadfcf7a7a310f757 100644 (file)
@@ -2307,6 +2307,6 @@ div#Playlist {
        padding: 1ex;
 }
 
-button.no-icon-remove::after {
+.playing button.no-icon-remove::after {
        content: "\0025fc";
 }
index f02a81f2e6476fe13d3ab8f6fec650395c85d74c..47f5486a9203c1e7bf8951944f370b0e7d82b03e 100644 (file)
                                thePlaylist.controlButtons['playpause'].removeClass('action-play').addClass('action-pause');
                                thePlaylist.afterPlay();
                        }).on('pause',function(){
+                               container.removeClass('playing');
                                $(this).removeClass('playing');
                                playpause.addClass('action-play').removeClass('action-pause');
                                thePlaylist.controlButtons['playpause'].removeClass('action-pause').addClass('action-play');
                        }).on('stop',function(){
+                               container.removeClass('playing');
+                               $(this).removeClass('playing');
                                $(this).trigger('pause');
                                if($(this)[0].currentTime){$(this)[0].currentTime = 0;}
                        }).on("ended", function(e){
                stopSounds: function() {
                        this.playlistContainer.find('audio').each(function(){$(this).trigger('stop');});        
                },
+               reset: function() {
+                       this.isActive = false;
+                       this.stopSounds();
+                       this.playlistContainer.find('*').remove();
+                       this._update();
+               }
        });
 })(jQuery);
 
index 7cf6f581ede93640eaebaa2dd1a267d7c342a9c6..e44e92bce9531f31d92a7e03290c8d489e8a7960 100644 (file)
@@ -331,6 +331,7 @@ $(function() {
                        if($(this).attr('data-player-action') == "registerAudio"){
                                $localList.playlist("registerAudio",audio);
                        }else if($(this).attr('data-player-action') == "playAudio"){
+                               $localList.playlist("reset");
                                $localList.playlist("registerAudio",audio);
                                $localList.playlist("playSoundId", sound_id);
                                if ($(this).parent().find('.icon-pause').length) {