Fix vimeo synchronization, slight playlist tweak

Clicking the delete button on a playlist entry now removes the button strip
before playing the removal animation, to prevent multiclicking
This commit is contained in:
calzoneman 2013-03-16 15:01:56 -05:00
parent 24f14530a4
commit d51b900010

View file

@ -16,7 +16,8 @@ function addUser(name, rank, leader) {
div.appendChild(flair);
div.appendChild(span);
fmtUserlistItem(div, rank, leader);
addUserDropdown(div, name);
if(RANK >= Rank.Moderator)
addUserDropdown(div, name);
$('#userlist')[0].appendChild(div);
}
@ -155,6 +156,7 @@ function addQueueButtons(li) {
// Callback time
$(btnRemove).click(function() {
btnstrip.remove();
var idx = $('#queue').children().index(li);
socket.emit('unqueue', { pos: idx });
});
@ -325,7 +327,7 @@ function initVI(data) {
var div = currentEmbed.parent();
currentEmbed.remove();
// Ugly but it's the only way I managed to get the API calls to work
div[0].innerHTML = '<iframe id="ytapiplayer" src="http://player.vimeo.com/video/' + data.id + '" width="640" height="390" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
div[0].innerHTML = '<iframe id="ytapiplayer" src="http://player.vimeo.com/video/' + data.id + '?api=1&player_id=ytapiplayer" width="640" height="390" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
// $f() is defined by froogaloop, Vimeo's API wrapper
PLAYER = $f($('iframe')[0]);
// So we can retrieve the ID synchronously instead of waiting for