mirror of https://github.com/calzoneman/sync.git
Improve setCurrent
This commit is contained in:
parent
29a1f0b9d3
commit
acb5136c15
|
@ -767,6 +767,8 @@ Callbacks = {
|
|||
queueAction({
|
||||
fn: function () {
|
||||
var li = makeQueueEntry(data.item, true);
|
||||
if (data.item.uid === PL_CURRENT)
|
||||
li.addClass("queue_active");
|
||||
li.hide();
|
||||
var q = $("#queue");
|
||||
li.attr("title", data.item.queueby
|
||||
|
@ -776,13 +778,11 @@ Callbacks = {
|
|||
li.prependTo(q);
|
||||
li.show("blind");
|
||||
return true;
|
||||
}
|
||||
else if(data.after === "append") {
|
||||
} else if (data.after === "append") {
|
||||
li.appendTo(q);
|
||||
li.show("blind");
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var liafter = playlistFind(data.after);
|
||||
if (!liafter) {
|
||||
return false;
|
||||
|
@ -873,27 +873,18 @@ Callbacks = {
|
|||
},
|
||||
|
||||
setCurrent: function(uid) {
|
||||
queueAction({
|
||||
fn: function () {
|
||||
PL_CURRENT = uid;
|
||||
var qli = $("#queue li");
|
||||
qli.removeClass("queue_active");
|
||||
$("#queue li").removeClass("queue_active");
|
||||
var li = $(".pluid-" + uid);
|
||||
if(li.length == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (li.length !== 0) {
|
||||
li.addClass("queue_active");
|
||||
var timer = setInterval(function () {
|
||||
var tmr = setInterval(function () {
|
||||
if (!PL_WAIT_SCROLL) {
|
||||
scrollQueue();
|
||||
clearInterval(timer);
|
||||
clearInterval(tmr);
|
||||
}
|
||||
}, 100);
|
||||
return true;
|
||||
},
|
||||
can_wait: true
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
changeMedia: function(data) {
|
||||
|
|
Loading…
Reference in New Issue