From c8a9e455886862c57cfe80086087496192ff164e Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 2 Nov 2011 20:02:11 +0000 Subject: [PATCH] some more work towards poster column in list view --- static/js/pandora/list.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/static/js/pandora/list.js b/static/js/pandora/list.js index 1bbcbf171..bffa420c7 100644 --- a/static/js/pandora/list.js +++ b/static/js/pandora/list.js @@ -547,20 +547,29 @@ pandora.ui.list = function() { } - if (['grid', 'timelines'].indexOf(pandora.user.ui.listView) > -1) { + if (['list', 'grid', 'timelines'].indexOf(pandora.user.ui.listView) > -1) { that.bindEvent({ pandora_icons: function(data) { - that.options({ + // fixme: doesn't update title icon, passes useless options + hasIcons() && that.options({ borderRadius: data.value == 'posters' ? 0 : 16, defaultRatio: data.value == 'posters' ? 5/8 : 1 }).reloadList(true); }, pandora_showsiteposter: function() { - pandora.user.ui.icons == 'posters' && that.reloadList(true); + // fixme: should be disabled if ui.icons != 'posters' + hasIcons() && pandora.user.ui.icons == 'posters' && that.reloadList(true); } }); } + function hasIcons() { + return ( + pandora.user.ui.listView == 'list' + && pandora.user.ui.listColumns.indexOf('posterRatio') > -1 + ) || ['grid', 'timelines'].indexOf(pandora.user.ui.listView) > -1; + } + return that; };