Sending conf as own message instead of with the list

This commit is contained in:
Kasper Rynning-Tønnesen
2015-07-03 15:15:16 +02:00
parent 7bbf09e697
commit 8b2f463b6d
3 changed files with 18 additions and 24 deletions

View File

@@ -12,14 +12,10 @@ var List = {
if(msg[0] == "list")
{
full_playlist = msg[1];
var index_of_conf = List.getIndexOfConf(full_playlist);
conf = full_playlist[index_of_conf];
full_playlist.splice(index_of_conf, 1);
full_playlist.sort(Helper.predicate({
name: 'votes',
reverse: true
name: 'votes',
reverse: true
}, 'added'));
Admin.set_conf(conf);
List.populate_list(full_playlist);
}else if(msg[0] == "added")
{
@@ -217,15 +213,5 @@ var List = {
}
});
return indexes[0];
},
getIndexOfConf: function(flist)
{
indexes = $.map(flist, function(obj, index) {
if("views" in obj) {
return index;
}
});
return indexes[0];
}
}