From f577c7abb2f4fd9806f879c8b72e2dfee91ae847 Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 24 Jan 2014 12:09:15 +0000 Subject: [PATCH] update embed grid --- static/js/embedGrid.js | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/static/js/embedGrid.js b/static/js/embedGrid.js index 165f51c7b..cf41562d2 100644 --- a/static/js/embedGrid.js +++ b/static/js/embedGrid.js @@ -4,6 +4,8 @@ pandora.ui.embedGrid = function() { var ui = pandora.user.ui, + options = getOptions(), + $list = Ox.IconList({ borderRadius: ui.icons == 'posters' ? 0 : 16, defaultRatio: ui.icons == 'posters' ? pandora.site.posters.ratio : 1, @@ -70,15 +72,25 @@ pandora.ui.embedGrid = function() { } }), - $statusbar = Ox.Bar({size: 16}) - .css({ - textAlign: 'center' - }), + $titlebar = Ox.Bar({size: 16}), - $status = Ox.Element() + $title = Ox.$('
') + .css({ + margin: '4px 4px', + textAlign: 'center', + overflow: 'hidden', + textOverflow: 'ellipsis' + }) + .html(options.title || '') + .appendTo($titlebar), + + $statusbar = Ox.Bar({size: 16}), + + $status = Ox.$('
') .css({ margin: '2px 4px', fontSize: '9px', + textAlign: 'center', overflow: 'hidden', textOverflow: 'ellipsis' }) @@ -86,13 +98,25 @@ pandora.ui.embedGrid = function() { .appendTo($statusbar), that = Ox.SplitPanel({ - elements: [ + elements: (options.title ? [ + {element: $titlebar, size: 24} + ] : []).concat([ {element: $list}, {element: $statusbar, size: 16} - ], + ]), orientation: 'vertical' }); + function getOptions() { + var options = {}; + if (ui._hash.query) { + ui._hash.query.forEach(function(condition) { + options[condition.key] = condition.value; + }); + } + return options; + } + that.resizePanel = function() { $list.size(); return that;