This commit is contained in:
calzoneman 2013-07-27 10:30:12 -04:00
parent be7ebf49d1
commit 6673e6c203
3 changed files with 14 additions and 4 deletions

View File

@ -340,10 +340,10 @@ Playlist.prototype.remove = function(uid, callback) {
fn: function() { fn: function() {
var item = pl.items.find(uid); var item = pl.items.find(uid);
if(pl.items.remove(uid)) { if(pl.items.remove(uid)) {
if(item == pl.current)
pl._next();
if(callback) if(callback)
callback(); callback();
if(item == pl.current)
pl._next();
} }
}, },
waiting: false waiting: false
@ -386,7 +386,6 @@ Playlist.prototype.next = function() {
return; return;
var it = this.current; var it = this.current;
this._next();
if(it.temp) { if(it.temp) {
var pl = this; var pl = this;
@ -394,6 +393,9 @@ Playlist.prototype.next = function() {
pl.on("remove")(it); pl.on("remove")(it);
}); });
} }
else {
this._next();
}
return this.current; return this.current;
} }

View File

@ -717,9 +717,11 @@ Callbacks = {
"delete": function(data) { "delete": function(data) {
queueAction({ queueAction({
fn: function () { fn: function () {
PL_WAIT_SCROLL = true;
var li = $(".pluid-" + data.uid); var li = $(".pluid-" + data.uid);
li.hide("blind", function() { li.hide("blind", function() {
li.remove(); li.remove();
PL_WAIT_SCROLL = false;
}); });
return true; return true;
} }
@ -749,7 +751,12 @@ Callbacks = {
} }
li.addClass("queue_active"); li.addClass("queue_active");
scrollQueue(); var timer = setInterval(function () {
if(!PL_WAIT_SCROLL) {
scrollQueue();
clearInterval(timer);
}
}, 100);
return true; return true;
}, },
can_wait: true can_wait: true

View File

@ -67,6 +67,7 @@ var SESSION = readCookie("cytube_session");
var LEADTMR = false; var LEADTMR = false;
var PL_FROM = ""; var PL_FROM = "";
var PL_AFTER = ""; var PL_AFTER = "";
var PL_WAIT_SCROLL = false;
var FILTER_FROM = 0; var FILTER_FROM = 0;
var FILTER_TO = 0; var FILTER_TO = 0;
var NO_STORAGE = typeof localStorage == "undefined" || localStorage === null; var NO_STORAGE = typeof localStorage == "undefined" || localStorage === null;