From f5fa1b59b45c11d25a6b0d6844d2888590d92c6e Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 16 Oct 2011 17:46:57 +0000 Subject: [PATCH] update icon text composition in timelines view --- static/js/pandora/ui/list.js | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/static/js/pandora/ui/list.js b/static/js/pandora/ui/list.js index 4f9ecb93..ed3c9ee5 100644 --- a/static/js/pandora/ui/list.js +++ b/static/js/pandora/ui/list.js @@ -190,19 +190,32 @@ pandora.ui.list = function() { defaultRatio: pandora.user.ui.icons == 'posters' ? 5/8 : 1, id: 'list', item: function(data, sort, size) { - var icons = pandora.user.ui.icons, - ratio = icons == 'posters' ? data.posterRatio : 1; size = 128; + var ui = pandora.user.ui, + ratio = ui.icons == 'posters' + ? (ui.showSitePoster ? 5/8 : data.posterRatio) : 1, + url = '/' + data.id + '/' + ( + ui.icons == 'posters' + ? (ui.showSitePoster ? 'siteposter' : 'poster') : 'icon' + ) + size + '.jpg', + format, info, sortKey = sort[0].key; + if (['title', 'director'].indexOf(sortKey) > -1) { + info = data['year']; + } else { + format = pandora.getSortKeyData(sortKey).format; + info = format + ? Ox['format' + Ox.toTitleCase(format.type)] + .apply(this, Ox.merge([data[sortKey]], format.args || [])) + : data[sortKey]; + } return { icon: { - height: ratio <= 1 ? size : size / ratio, + height: Math.round(ratio <= 1 ? size : size / ratio), id: data.id, - info: data[['title', 'director'].indexOf(sort[0].key) > -1 ? 'year' : sort[0].key], + info: info, title: data.title + (data.director.length ? ' (' + data.director.join(', ') + ')' : ''), - url: icons == 'posters' - ? '/' + data.id + '/poster' + size + '.jpg' - : '/' + data.id + '/icon' + size + '.jpg', - width: ratio >= 1 ? size : size * ratio + url: url, + width: Math.round(ratio >= 1 ? size : size * ratio) }, info: { css: {