1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fixed js closures

This commit is contained in:
Luke Pulverenti 2013-04-10 17:03:28 -04:00
parent 98bf4945e4
commit 683d8d69a9
2 changed files with 338 additions and 333 deletions

View file

@ -1,25 +1,28 @@
var Playlist = (function() {
(function (window) {
var self = this;
function playlist() {
var self = this;
self.queue = [];
self.queue = [];
self.add = function(item) {
self.add = function (item) {
queue.push(item);
};
queue.push(item);
};
self.remove = function (index) {
self.remove = function (index) {
queue.splice(index, 1);
};
queue.splice(index, 1);
};
self.play = function (index) {
MediaPlayer.play(queue[index]);
queue.shift();
};
self.play = function (index) {
return self;
MediaPlayer.play(queue[index]);
queue.shift();
};
})();
return self;
}
window.Playlist = new playlist();
})(window);