Commit 0a5b01af authored by Simon Daron's avatar Simon Daron
Browse files

Debug player, a bug occured to play again when liste has been cleared

parent 3706345a
......@@ -39,9 +39,8 @@
this.element.append(this.debugContainer);
this.playlist = this.options.playlist;
this.buildPlaylistControls();
this.loadPlaylist();
this.options.onLoad(this);
this._update();
this.options.onLoad(this);
},
_setOption: function( key, value ) {
......@@ -60,6 +59,12 @@
this.options.onUpdate(this);
return this.playlist;
},
_reset: function() {
this.isActive =false;
this.stopSounds();
this.playlistContainer.find('*').remove();
this._update();
},
savePlaylist: function(){
localStorage['playlist'] = JSON.stringify(this.playlist, null, '\t');
},
......@@ -174,7 +179,7 @@
},
// Build controls
buildPlaylistControls: function() {
this.controls = $('<div>',{class:'playlistControls controls'});
this.controlContainer.empty();
/*
this.registerControl('toggleList',{class:"icon-list",click: function(){
thePlaylist.playlistContainer.toggle();
......
......@@ -220,8 +220,7 @@ $(function() {
self.playlistContainer.toggleClass('deploy');
});
$('#emptyList').on('click',function(){
self.playlistContainer.empty();
self._update();
self._reset();
});
if(self.isActive){
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment