fix a status bar bug

This commit is contained in:
rolux 2011-12-23 08:17:51 +00:00
parent 4a6ac7fae5
commit 0f3b554dcb

View file

@ -417,9 +417,12 @@ pandora.ui.list = function() {
pandora.UI.set(set); pandora.UI.set(set);
}, },
openpreview: function(data) { openpreview: function(data) {
if (data.ids.length) {
}
pandora.requests.preview && pandora.api.cancel(pandora.requests.preview); pandora.requests.preview && pandora.api.cancel(pandora.requests.preview);
pandora.requests.preview = pandora.api.find({ pandora.requests.preview = pandora.api.find({
keys: ['director', 'id', 'posterRatio', 'title'], keys: ['director', 'id', 'posterRatio', 'title', 'year'],
query: { query: {
conditions: data.ids.map(function(id) { conditions: data.ids.map(function(id) {
return { return {
@ -432,7 +435,7 @@ pandora.ui.list = function() {
} }
}, function(result) { }, function(result) {
var item = result.data.items[0], var item = result.data.items[0],
title = item.title + ' (' + item.director + ')', title = item.title + ' (' + item.director.join(', ') + ') ' + item.year,
ratio = item.posterRatio, ratio = item.posterRatio,
windowWidth = window.innerWidth * 0.8, windowWidth = window.innerWidth * 0.8,
windowHeight = window.innerHeight * 0.8, windowHeight = window.innerHeight * 0.8,
@ -472,7 +475,7 @@ pandora.ui.list = function() {
}) })
.open(); .open();
} else { } else {
pandora.$ui.previewDialog.options({ pandora.$ui.previewDialog.options({
content: pandora.$ui.previewImage, content: pandora.$ui.previewImage,
height: height, height: height,
title: title, title: title,
@ -507,36 +510,40 @@ pandora.ui.list = function() {
pandora.$ui.mainMenu.disableItem('openmovie'); pandora.$ui.mainMenu.disableItem('openmovie');
} }
pandora.$ui.leftPanel.replaceElement(2, pandora.$ui.info = pandora.ui.info()); pandora.$ui.leftPanel.replaceElement(2, pandora.$ui.info = pandora.ui.info());
if (Ox.isUndefined(data.rest)) { if (data.ids.length == 0) {
query = { pandora.$ui.selected.html(pandora.ui.status('selected', {items: 0}));
conditions: data.ids.map(function(id) {
return {
key: 'id',
value: id,
operator: '=='
}
}),
operator: '|'
};
} else { } else {
query = { if (Ox.isUndefined(data.rest)) {
conditions: Ox.merge([ query = {
pandora.user.ui.find conditions: data.ids.map(function(id) {
], data.rest.map(function(id) { return {
return { key: 'id',
key: 'id', value: id,
value: id, operator: '=='
operator: '!=' }
}; }),
})), operator: '|'
operator: '&' };
}; } else {
query = {
conditions: Ox.merge([
pandora.user.ui.find
], data.rest.map(function(id) {
return {
key: 'id',
value: id,
operator: '!='
};
})),
operator: '&'
};
}
pandora.api.find({
query: query
}, function(result) {
pandora.$ui.selected.html(pandora.ui.status('selected', result.data));
});
} }
pandora.api.find({
query: query
}, function(result) {
pandora.$ui.selected.html(pandora.ui.status('selected', result.data));
});
}, },
pandora_listselection: function(data) { pandora_listselection: function(data) {
that.options({selected: data.value}); that.options({selected: data.value});