From 885d80dbcc5737afff878a9222d8f3e66d20ab96 Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 7 Aug 2011 03:04:33 +0000 Subject: [PATCH] update item clips view --- static/js/pandora/ui/item.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/static/js/pandora/ui/item.js b/static/js/pandora/ui/item.js index f6b9c8867..42d281fdd 100644 --- a/static/js/pandora/ui/item.js +++ b/static/js/pandora/ui/item.js @@ -20,13 +20,15 @@ pandora.ui.item = function() { } else if (pandora.user.ui.itemView == 'calendar') { pandora.$ui.contentPanel.replaceElement(1, Ox.Element().html('Calendar')); } else if (pandora.user.ui.itemView == 'clips') { + var ratio = result.data.stream.aspectRatio; + Ox.print('RATIO', ratio) pandora.$ui.contentPanel.replaceElement(1, pandora.$ui.clips = Ox.IconList({ + fixedRatio: ratio, item: function(data, sort, size) { size = size || 128; - var ratio = result.data.stream.aspectRatio, - width = ratio > 1 ? size : Math.round(size * ratio), + var width = ratio > 1 ? size : Math.round(size * ratio), height = ratio > 1 ? Math.round(size / ratio) : size, - url = '/' + pandora.user.ui.item + '/' + size + 'p' + data['in'] + '.jpg'; + url = '/' + pandora.user.ui.item + '/' + height + 'p' + data['in'] + '.jpg'; return { height: height, id: data['id'],