fix icon list preview

This commit is contained in:
rolux 2011-08-21 03:12:46 +00:00
parent aebe5be0d0
commit 97749b22c0

View file

@ -517,19 +517,19 @@ pandora.ui.list = function() { // fixme: remove view argument
}, function(result) { }, function(result) {
var item = result.data.items[0], var item = result.data.items[0],
title = item.title + ' (' + item.director + ')' title = item.title + ' (' + item.director + ')'
ratio = item.poster.width / item.poster.height, ratio = item.posterRatio,
windowWidth = window.innerWidth * 0.8, windowWidth = window.innerWidth * 0.8,
windowHeight = window.innerHeight * 0.8, windowHeight = window.innerHeight * 0.8,
windowRatio = windowWidth / windowHeight, windowRatio = windowWidth / windowHeight,
width = Math.round(ratio > windowRatio ? windowWidth : windowHeight * ratio), width = Math.round(ratio > windowRatio ? windowWidth : windowHeight * ratio),
height = Math.round(ratio < windowRatio ? windowHeight : windowWidth / ratio); height = Math.round(ratio < windowRatio ? windowHeight : windowWidth / ratio);
pandora.$ui.previewImage = $('<img>') pandora.$ui.previewImage = $('<img>')
.attr({src: item.poster.url.replace('.jpg', '128.jpg')}) .attr({src: '/' + item.id + '/poster128.jpg'})
.css({width: width + 'px', height: height + 'px'}) .css({width: width + 'px', height: height + 'px'})
$('<img>').load(function() { $('<img>').load(function() {
pandora.$ui.previewImage.attr({src: $(this).attr('src')}); pandora.$ui.previewImage.attr({src: $(this).attr('src')});
}) })
.attr({src: item.poster.url.replace('.jpg', '1024.jpg')}); .attr({src: '/' + item.id + '/poster1024.jpg'});
if (!preview) { if (!preview) {
if (!pandora.$ui.previewDialog) { if (!pandora.$ui.previewDialog) {
pandora.$ui.previewDialog = Ox.Dialog({ pandora.$ui.previewDialog = Ox.Dialog({