forked from 0x2620/pandora
metadata dialog: cosmetic changes
This commit is contained in:
parent
97d1c337f8
commit
1f800c0361
1 changed files with 20 additions and 19 deletions
|
@ -191,10 +191,27 @@ pandora.ui.metadataDialog = function(data) {
|
|||
});
|
||||
}
|
||||
|
||||
function getMetadata(id, callback) {
|
||||
function formatValue(key, value) {
|
||||
return !value ? ''
|
||||
: key == 'alternativeTitles' ? value.map(function(v) {
|
||||
return v[0];
|
||||
}).join('; ')
|
||||
: key == 'runtime' ? Math.round(value / 60) + ' min'
|
||||
: Ox.isArray(
|
||||
Ox.getObjectById(pandora.site.itemKeys, key).type
|
||||
) ? value.join(', ')
|
||||
: value;
|
||||
}
|
||||
|
||||
function getFormWidth() {
|
||||
return dialogWidth - 32 - Ox.UI.SCROLLBAR_SIZE;
|
||||
}
|
||||
|
||||
function getMetadata() {
|
||||
pandora.api.getMetadata({id: data.imdbId, keys: keys.concat(['originalTitle'])}, function(result) {
|
||||
var $bar = Ox.Bar({size: 24}),
|
||||
$data = Ox.Element().css({padding: '12px', overflowY: 'auto'}),
|
||||
$data = Ox.Element()
|
||||
.css({padding: '12px', overflowY: 'auto'}),
|
||||
$content = Ox.SplitPanel({
|
||||
elements: [
|
||||
{element: $bar, size: 24},
|
||||
|
@ -284,7 +301,7 @@ pandora.ui.metadataDialog = function(data) {
|
|||
.appendTo($data);
|
||||
});
|
||||
});
|
||||
that.options({content: $content})
|
||||
that.options({content: $content});
|
||||
updateKeys = getUpdateKeys();
|
||||
updateButtons();
|
||||
} else {
|
||||
|
@ -293,22 +310,6 @@ pandora.ui.metadataDialog = function(data) {
|
|||
});
|
||||
}
|
||||
|
||||
function formatValue(key, value) {
|
||||
return !value ? ''
|
||||
: key == 'alternativeTitles' ? value.map(function(v) {
|
||||
return v[0];
|
||||
}).join('; ')
|
||||
: key == 'runtime' ? Math.round(value / 60) + ' min'
|
||||
: Ox.isArray(
|
||||
Ox.getObjectById(pandora.site.itemKeys, key).type
|
||||
) ? value.join(', ')
|
||||
: value;
|
||||
}
|
||||
|
||||
function getFormWidth() {
|
||||
return dialogWidth - 32 - Ox.UI.SCROLLBAR_SIZE;
|
||||
}
|
||||
|
||||
function getTitle(key) {
|
||||
return key == 'alternativeTitles' ? 'Alternative Titles'
|
||||
: Ox.getObjectById(pandora.site.itemKeys, key).title;
|
||||
|
|
Loading…
Reference in a new issue