update embed grid

This commit is contained in:
rolux 2014-01-24 12:09:15 +00:00
parent 4387d8e97e
commit f577c7abb2

View file

@ -4,6 +4,8 @@ pandora.ui.embedGrid = function() {
var ui = pandora.user.ui, var ui = pandora.user.ui,
options = getOptions(),
$list = Ox.IconList({ $list = Ox.IconList({
borderRadius: ui.icons == 'posters' ? 0 : 16, borderRadius: ui.icons == 'posters' ? 0 : 16,
defaultRatio: ui.icons == 'posters' ? pandora.site.posters.ratio : 1, defaultRatio: ui.icons == 'posters' ? pandora.site.posters.ratio : 1,
@ -70,15 +72,25 @@ pandora.ui.embedGrid = function() {
} }
}), }),
$statusbar = Ox.Bar({size: 16}) $titlebar = Ox.Bar({size: 16}),
.css({
textAlign: 'center'
}),
$status = Ox.Element() $title = Ox.$('<div>')
.css({
margin: '4px 4px',
textAlign: 'center',
overflow: 'hidden',
textOverflow: 'ellipsis'
})
.html(options.title || '')
.appendTo($titlebar),
$statusbar = Ox.Bar({size: 16}),
$status = Ox.$('<div>')
.css({ .css({
margin: '2px 4px', margin: '2px 4px',
fontSize: '9px', fontSize: '9px',
textAlign: 'center',
overflow: 'hidden', overflow: 'hidden',
textOverflow: 'ellipsis' textOverflow: 'ellipsis'
}) })
@ -86,13 +98,25 @@ pandora.ui.embedGrid = function() {
.appendTo($statusbar), .appendTo($statusbar),
that = Ox.SplitPanel({ that = Ox.SplitPanel({
elements: [ elements: (options.title ? [
{element: $titlebar, size: 24}
] : []).concat([
{element: $list}, {element: $list},
{element: $statusbar, size: 16} {element: $statusbar, size: 16}
], ]),
orientation: 'vertical' 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() { that.resizePanel = function() {
$list.size(); $list.size();
return that; return that;