some changes towards fixed height icon lists

This commit is contained in:
rolux 2011-08-06 04:28:19 +00:00
parent 280373f88e
commit 2305fa4d20
3 changed files with 13 additions and 6 deletions

View file

@ -38,6 +38,7 @@ pandora.ui.browser = function() {
} else {
var that = Ox.IconList({
centered: true,
defaultRatio: 5/8,
id: 'list',
item: function(data, sort, size) {
var ratio = data.poster.width / data.poster.height;

View file

@ -334,6 +334,7 @@ pandora.ui.infoView = function(data) {
return image.selected;
})[0];
$list = Ox.IconList({
defaultRatio: 5/8,
item: function(data, sort, size) {
var ratio = data.width / data.height;
size = size || 128;

View file

@ -72,6 +72,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument
});
} else if (view == 'icons') {
that = Ox.IconList({
defaultRatio: 5/8,
id: 'list',
item: function(data, sort, size) {
var ratio = data.poster.width / data.poster.height;
@ -108,6 +109,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument
that = Ox.Element().css({margin: '16px'}).html(view + ' results view still missing.');
} else if (view == 'clip') {
that = Ox.IconList({
fixedRatio: 4/3,
item: function(data, sort, size) {
size = size || 128;
var ratio = data.aspectRatio,
@ -190,16 +192,19 @@ pandora.ui.list = function(view) { // fixme: remove view argument
},
{
element: pandora.$ui.clips = Ox.IconList({
fixedRatio: 4/3,
item: function(data, sort, size) {
Ox.print('RATIO', data.aspectRatio);
size = size || 128;
var ratio = data.aspectRatio,
width = size,
height = size/ratio,
url = '/' + data.item + '/frame/' + size + '/'+data['in'] + '.jpg';
var fixedRatio = 4/3,
width = data.aspectRatio < fixedRatio ? size : size * data.aspectRatio / fixedRatio,
height = width / data.aspectRatio,
url = '/' + data.item + '/frame/' + width + '/' + data['in'] + '.jpg';
return {
height: height,
id: data['id'],
info: Ox.formatDuration(data['in'], 'short') +' - '+ Ox.formatDuration(data['out'], 'short'),
id: data.id,
info: Ox.formatDuration(data['in'], 'short') + ' - '
+ Ox.formatDuration(data['out'], 'short'),
title: data.value,
url: url,
width: width