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,
@ -507,6 +510,9 @@ 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 (data.ids.length == 0) {
pandora.$ui.selected.html(pandora.ui.status('selected', {items: 0}));
} else {
if (Ox.isUndefined(data.rest)) { if (Ox.isUndefined(data.rest)) {
query = { query = {
conditions: data.ids.map(function(id) { conditions: data.ids.map(function(id) {
@ -537,6 +543,7 @@ pandora.ui.list = function() {
}, function(result) { }, function(result) {
pandora.$ui.selected.html(pandora.ui.status('selected', result.data)); 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});