Skip to content
Snippets Groups Projects
Commit bddf87e6 authored by ale's avatar ale
Browse files

call history.restore() on init

parent 5e3f2450
Branches
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ djr.init = function (userid) { ...@@ -22,6 +22,7 @@ djr.init = function (userid) {
// Set a callback on URL hash changes. // Set a callback on URL hash changes.
$(window).bind('hashchange', djr.history.restore); $(window).bind('hashchange', djr.history.restore);
djr.history.restore();
// Set autocompletion and search handlers. // Set autocompletion and search handlers.
$('#queryField').autocomplete('/autocomplete', { $('#queryField').autocomplete('/autocomplete', {
......
...@@ -32,10 +32,12 @@ djr.Player.prototype.hideAllChunks = function() { ...@@ -32,10 +32,12 @@ djr.Player.prototype.hideAllChunks = function() {
djr.Player.prototype.removeChunk = function(chunk_id) { djr.Player.prototype.removeChunk = function(chunk_id) {
this.playlist.removeChunk(chunk_id); this.playlist.removeChunk(chunk_id);
$('#chunk_' + chunk_id).remove(); $('#chunk_' + chunk_id).remove();
this.savePlaylist();
// If the playlist is now empty, switch to a new uuid. // If the playlist is now empty, switch to a new uuid.
if (this.playlist.isEmpty()) { if (this.playlist.isEmpty()) {
this.clearPlaylist(); this.clearPlaylist();
} else {
// Only save the playlist if not empty.
this.savePlaylist();
} }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment