fix bugs in id dialog

This commit is contained in:
rolux 2013-03-02 15:31:50 +05:30
parent 06ac4b9c6e
commit b0c80a5f47

View file

@ -90,9 +90,21 @@ pandora.ui.idDialog = function(data) {
});
pandora.api.getIds(get, function(result) {
var checkboxes = [];
if (!data.imdbId) {
checkboxes.push(
{
id: 'none',
title: getTitle({
id: data.imdbId,
title: data.title,
director: data.director,
year: data.year
})
}
);
}
$content = Ox.Element()
.css({padding: '13px', overflowY: 'auto'});
if (result.data.items.length) {
['title', 'director', 'year'].forEach(function(key) {
$input.push(
Ox.Input({
@ -119,19 +131,6 @@ pandora.ui.idDialog = function(data) {
$('<div>')
.css({width: '1px', height: '8px'})
.appendTo($content);
if (!data.imdbId) {
checkboxes.push(
{
id: 'none',
title: getTitle({
id: data.imdbId,
title: data.title,
director: data.director,
year: data.year
})
}
);
}
(
data.imdbId
&& Ox.getIndexById(result.data.items, data.imdbId) == -1
@ -185,17 +184,17 @@ pandora.ui.idDialog = function(data) {
), '_blank');
}
})
.appendTo(elements[index])
.appendTo(elements[index]);
}
});
that.options({content: $content});
updateButton();
});
}
});
}
function getTitle(item) {
item = Ox.clone(item, true);
if (item.id && item.id == data.imdbId) {
item.id = highlightTitle(item.id);
}