fix media status

This commit is contained in:
j 2014-06-10 13:36:11 +02:00
parent e28542578d
commit 284544f733

View file

@ -80,24 +80,25 @@ pandora.ui.mediaView = function(options) {
return ['uploading', 'queued', 'encoding'].indexOf(data.state) == -1; return ['uploading', 'queued', 'encoding'].indexOf(data.state) == -1;
}, },
format: function(value, data) { format: function(value, data) {
var opacity = value
|| ['encoding', 'failed', 'queued', 'uploading', 'wanted'].indexOf(data.state) > -1
? 1 : 0;
return $('<img>') return $('<img>')
.attr({ .attr({
src: ['uploading', 'queued', 'encoding', 'failed'].indexOf(data.state) > -1 src: Ox.UI.getImageURL('symbol' + {
? Ox.UI.getImageURL('symbol' + { 'available': 'Check',
'uploading': 'Upload', 'encoding': 'Sync',
'queued': 'Data', 'failed': 'Warning',
'encoding': 'Sync', 'queued': 'Data',
'failed': 'Warning' 'uploading': 'Upload',
}[data.state]) 'wanted': 'Up',
: data.wanted }[data.state])
? Ox.UI.getImageURL('symbolUp')
: Ox.UI.getImageURL('symbolCheck')
}) })
.css({ .css({
width: '10px', width: '10px',
height: '10px', height: '10px',
padding: '3px', padding: '3px',
opacity: (value || data.wanted) ? 1 : 0 opacity: opacity
}); });
}, },
id: 'selected', id: 'selected',