update item clips view

This commit is contained in:
rlx 2011-08-07 03:04:33 +00:00
parent 783bf01f67
commit 3eed18eda3

View file

@ -20,13 +20,15 @@ pandora.ui.item = function() {
} else if (pandora.user.ui.itemView == 'calendar') { } else if (pandora.user.ui.itemView == 'calendar') {
pandora.$ui.contentPanel.replaceElement(1, Ox.Element().html('Calendar')); pandora.$ui.contentPanel.replaceElement(1, Ox.Element().html('Calendar'));
} else if (pandora.user.ui.itemView == 'clips') { } 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({ pandora.$ui.contentPanel.replaceElement(1, pandora.$ui.clips = Ox.IconList({
fixedRatio: ratio,
item: function(data, sort, size) { item: function(data, sort, size) {
size = size || 128; size = size || 128;
var ratio = result.data.stream.aspectRatio, var width = ratio > 1 ? size : Math.round(size * ratio),
width = ratio > 1 ? size : Math.round(size * ratio),
height = ratio > 1 ? Math.round(size / ratio) : size, 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 { return {
height: height, height: height,
id: data['id'], id: data['id'],