From 2a104307f86f0e598f847ffd347f550b973edb55 Mon Sep 17 00:00:00 2001 From: Astro Date: Fri, 26 Nov 2010 11:10:59 +0100 Subject: [PATCH] play-resources: fix container insertion in case of no alternatives --- content/static/script/play-resources.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/static/script/play-resources.js b/content/static/script/play-resources.js index 1fd0ecea8..cefc38bb4 100644 --- a/content/static/script/play-resources.js +++ b/content/static/script/play-resources.js @@ -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 = $('
  • '); - alternativeEls.last().after(liEl); + ((alternativeEls.length < 1) ? $(this) : alternativeEls.last()).after(liEl); var player = addButton(liEl, res); } });