mirror of https://github.com/calzoneman/sync.git
Add a wait condition to prevent playlist highlight being messed up
This commit is contained in:
parent
d688a63bfa
commit
f10a5d7ec3
|
@ -708,6 +708,13 @@ Callbacks = {
|
||||||
},
|
},
|
||||||
|
|
||||||
setPosition: function(position) {
|
setPosition: function(position) {
|
||||||
|
// Wait until any pending movement is finished
|
||||||
|
if(MOVING) {
|
||||||
|
setTimeout(function() {
|
||||||
|
Callbacks.move(position);
|
||||||
|
}, 100);
|
||||||
|
return;
|
||||||
|
}
|
||||||
$("#queue li").each(function() {
|
$("#queue li").each(function() {
|
||||||
$(this).removeClass("queue_active");
|
$(this).removeClass("queue_active");
|
||||||
});
|
});
|
||||||
|
|
|
@ -40,6 +40,7 @@ if($("#ytapiplayer").length > 0) {
|
||||||
var VHEIGHT = ""+parseInt(parseInt(VWIDTH) * 9 / 16);
|
var VHEIGHT = ""+parseInt(parseInt(VWIDTH) * 9 / 16);
|
||||||
}
|
}
|
||||||
var POSITION = -1;
|
var POSITION = -1;
|
||||||
|
var MOVING = false;
|
||||||
var REBUILDING = false;
|
var REBUILDING = false;
|
||||||
var socket = {
|
var socket = {
|
||||||
emit: function() {
|
emit: function() {
|
||||||
|
|
|
@ -952,6 +952,7 @@ function playlistMove(from, to) {
|
||||||
if(from >= q.children().length)
|
if(from >= q.children().length)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
MOVING = true;
|
||||||
var old = $(q.children()[from]);
|
var old = $(q.children()[from]);
|
||||||
old.hide("blind", function() {
|
old.hide("blind", function() {
|
||||||
old.detach();
|
old.detach();
|
||||||
|
@ -960,6 +961,7 @@ function playlistMove(from, to) {
|
||||||
else
|
else
|
||||||
old.insertBefore(q.children()[to]);
|
old.insertBefore(q.children()[to]);
|
||||||
old.show("blind");
|
old.show("blind");
|
||||||
|
MOVING = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue