fix setting inital frames, use modified for icons

This commit is contained in:
j 2013-05-10 14:16:35 +00:00
parent 6cfe105940
commit dacac4562e

View file

@ -15,7 +15,7 @@ pandora.ui.listDialog = function(section) {
), ),
ui = pandora.user.ui, ui = pandora.user.ui,
width = getWidth(section), width = getWidth(section),
folderItems = ui.section == 'items' ? Ox._('Lists') : Ox.toTitleCase(ui.section), folderItems = ui.section == 'items' ? 'Lists' : Ox.toTitleCase(ui.section),
folderItem = folderItems.slice(0, -1); folderItem = folderItems.slice(0, -1);
Ox.getObjectById(tabs, section).selected = true; Ox.getObjectById(tabs, section).selected = true;
@ -402,7 +402,8 @@ pandora.ui.listIconPanel = function(listData) {
$interface = Ox.Element({ $interface = Ox.Element({
tooltip: function(e) { tooltip: function(e) {
return 'Edit ' + $(e.target).attr('id').replace('-', ' ') + ' image'; var quarterName = ($(e.target).attr('id') || '').replace('-', ' ');
return quarterName ? Ox._('Edit ' + quarterName + ' image') : null;
} }
}) })
.css({ .css({
@ -434,7 +435,7 @@ pandora.ui.listIconPanel = function(listData) {
id: data.id, id: data.id,
info: data[['title', 'director'].indexOf(sort[0].key) > -1 ? 'year' : sort[0].key], info: data[['title', 'director'].indexOf(sort[0].key) > -1 ? 'year' : sort[0].key],
title: data.title + (data.director.length ? ' (' + data.director.join(', ') + ')' : ''), title: data.title + (data.director.length ? ' (' + data.director.join(', ') + ')' : ''),
url: '/' + data.id + '/icon' + size + '.jpg', url: '/' + data.id + '/icon' + size + '.jpg?' + data.modified,
width: size width: size
}; };
}, },
@ -446,7 +447,7 @@ pandora.ui.listIconPanel = function(listData) {
} }
}), callback); }), callback);
}, },
keys: ['director', 'duration', 'id', 'posterFrame', 'title', 'videoRatio', 'year'], keys: ['director', 'duration', 'id', 'modified', 'posterFrame', 'title', 'videoRatio', 'year'],
max: 1, max: 1,
min: 1, min: 1,
//orientation: 'vertical', //orientation: 'vertical',
@ -473,7 +474,7 @@ pandora.ui.listIconPanel = function(listData) {
} else { } else {
itemData = $list.value(posterFrame.item); itemData = $list.value(posterFrame.item);
} }
posterFrames.length && renderPreview(itemData); itemData && renderPreview(itemData);
} }
}) })
.gainFocus(); .gainFocus();
@ -536,7 +537,7 @@ pandora.ui.listIconPanel = function(listData) {
if (posterFrames.length) { if (posterFrames.length) {
posterFrames[quarter] = posterFrame; posterFrames[quarter] = posterFrame;
} else { } else {
posterFrames = Ox.repeat([posterFrame], 4); posterFrames = Ox.range(4).map(function() { return Ox.clone(posterFrame); } );
} }
pandora.api['edit' + folderItem]({ pandora.api['edit' + folderItem]({
id: listData.id, id: listData.id,
@ -551,7 +552,6 @@ pandora.ui.listIconPanel = function(listData) {
src: '/' + folderItem.toLowerCase() + '/' + listData.id + '/icon.jpg?' + Ox.uid() src: '/' + folderItem.toLowerCase() + '/' + listData.id + '/icon.jpg?' + Ox.uid()
}); });
pandora.$ui.info.updateListInfo(); pandora.$ui.info.updateListInfo();
pandora.clearListIconCache(listData.id);
}); });
$preview.options({position: position}); $preview.options({position: position});
} }