use correct cover in preview

This commit is contained in:
rlx 2016-01-12 14:07:41 +05:30
parent b71b35a418
commit 16c0514809

View file

@ -7,8 +7,10 @@ oml.ui.previewDialog = function() {
$image,
$list = oml.$ui.list,
item = Ox.last($list.options('selected')),
coverRatio = $list.value(item, 'coverRatio') || oml.config.iconRatio,
size = getSize(coverRatio),
imageRatio = $list.value(
item, ui.icons == 'cover' ? 'coverRatio' : 'previewRatio'
) || oml.config.iconRatio,
size = getSize(imageRatio),
that = Ox.Dialog({
closeButton: true,
@ -55,11 +57,13 @@ oml.ui.previewDialog = function() {
that.updateElement = function() {
oml.api.get({
id: Ox.last($list.options('selected')),
keys: ['coverRatio', 'id', 'modified', 'title']
keys: ['coverRatio', 'id', 'modified', 'previewRatio', 'title']
}, function(result) {
var item = result.data,
coverRatio = item.coverRatio || oml.config.iconRatio,
size = getSize(coverRatio),
imageRatio = item[
ui.icons == 'cover' ? 'coverRatio' : 'previewRatio'
] || oml.config.iconRatio,
size = getSize(imageRatio),
title = Ox.encodeHTMLEntities(item.title);
$image = $('<img>')
.attr({
@ -76,7 +80,7 @@ oml.ui.previewDialog = function() {
});
})
.attr({
src: '/' + item.id + '/cover1024.jpg?' + item.modified
src: '/' + item.id + '/' + ui.icons + '1024.jpg?' + item.modified
});
that.options({
content: $image,