From 881eb58e82e0799f464ec2087e82deb87e86f81b Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 7 Jun 2011 05:28:29 +0000 Subject: [PATCH] some fixes for preview dialog --- static/js/pandora/ui/list.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/static/js/pandora/ui/list.js b/static/js/pandora/ui/list.js index 442bfdbb2..d7c6b5bb1 100644 --- a/static/js/pandora/ui/list.js +++ b/static/js/pandora/ui/list.js @@ -335,10 +335,10 @@ pandora.ui.list = function(view) { // fixme: remove view argument var documentHeight = pandora.$ui.document.height(), item = result.data.items[0], title = item.title + (item.director ? ' (' + item.director + ')' : ''), - dialogHeight = documentHeight - 100, + dialogHeight = documentHeight - 48, dialogWidth; pandora.site.previewRatio = item.poster.width / item.poster.height, - dialogWidth = parseInt((dialogHeight - 48) * pandora.site.previewRatio); + dialogWidth = Math.round((dialogHeight - 48) * pandora.site.previewRatio); if ('previewDialog' in pandora.$ui) { pandora.$ui.previewDialog.options({ title: title @@ -355,7 +355,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument pandora.$ui.previewImage .css({ width: dialogWidth + 'px', - height: (dialogHeight - 48 - 2) + 'px', // fixme: why -2 ? + height: (dialogHeight - 48) + 'px', // fixme: why -2 ? opacity: 0 }) .animate({ @@ -373,7 +373,7 @@ pandora.ui.list = function(view) { // fixme: remove view argument .css({ position: 'absolute', width: dialogWidth + 'px', - height: (dialogHeight - 48 - 2) + 'px', // fixme: why -2 ? + height: (dialogHeight - 48) + 'px', // fixme: why -2 ? left: 0, top: 0, right: 0, @@ -393,10 +393,11 @@ pandora.ui.list = function(view) { // fixme: remove view argument }) ], content: pandora.$ui.previewImage, + focus: false, height: dialogHeight, id: 'previewDialog', - minHeight: pandora.site.previewRatio >= 1 ? 128 / pandora.site.previewRatio + 48 : 176, - minWidth: pandora.site.previewRatio >= 1 ? 128 : 176 * pandora.site.previewRatio, + minHeight: pandora.site.previewRatio >= 1 ? Math.round(128 / pandora.site.previewRatio) + 48 : 176, + minWidth: pandora.site.previewRatio >= 1 ? 128 : Math.round(176 * pandora.site.previewRatio), padding: 0, title: title, width: dialogWidth @@ -406,10 +407,10 @@ pandora.ui.list = function(view) { // fixme: remove view argument height, width; if (dialogRatio < pandora.site.previewRatio) { width = data.width; - height = width / pandora.site.previewRatio; + height = Math.round(width / pandora.site.previewRatio); } else { - height = (data.height - 48 - 2); - width = height * pandora.site.previewRatio; + height = (data.height - 48); + width = Math.round(height * pandora.site.previewRatio); } pandora.$ui.previewImage.css({ width: width + 'px',