summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2012-03-05 23:04:03 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2012-03-05 23:04:03 +0100
commit32713ba6fbe7edaeec888a3d64e7cbf16ff547b7 (patch)
tree13114aed01fc3f80429d4a34dbff0c59003ffadf /static
parent5a0d0b7fa043678d09409e3b0a7a9d541b65663f (diff)
Fixed playlist storage.
Diffstat (limited to 'static')
-rw-r--r--static/playlist.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/static/playlist.js b/static/playlist.js
index 1de78fa..99ec6c5 100644
--- a/static/playlist.js
+++ b/static/playlist.js
@@ -29,7 +29,9 @@ $(function(){
initialize: function() {
items.bind('add', this.addOne, this);
items.bind('remove', this.removeOne, this);
+ items.bind('reset', this.addAll, this);
this.current = null;
+ items.fetch();
},
add: function(item) {
var model = items.create(item);
@@ -43,6 +45,10 @@ $(function(){
},
removeOne: function(item) {
$('#playlist #cid-' + item.cid).remove();
+ item.destroy();
+ },
+ addAll: function() {
+ items.each(this.addOne);
},
next: function() {
var item = items.at(0);