play-resources: fix container insertion in case of no alternatives

This commit is contained in:
Astro 2010-11-26 11:10:59 +01:00
parent 802553cc00
commit 2a104307f8
1 changed files with 3 additions and 3 deletions

View File

@ -107,11 +107,11 @@ $(document).ready(function() {
res.preview = preview;
/* Check playability */
if (res.map(function(res) {
return res.type;
if (res.map(function(r) {
return r.type;
}).some(canPlay)) {
var liEl = $('<li></li>');
alternativeEls.last().after(liEl);
((alternativeEls.length < 1) ? $(this) : alternativeEls.last()).after(liEl);
var player = addButton(liEl, res);
}
});