some changes towards fixed height icon lists

This commit is contained in:
rlx 2011-08-06 04:28:19 +00:00
parent ace1817c9a
commit bfcb489c5c
3 changed files with 13 additions and 6 deletions

View file

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

View file

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

View file

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