FIX - фоторама при одной фотке
This commit is contained in:
parent
8df0cf677a
commit
429fb895cf
|
|
@ -78,19 +78,19 @@ function closeBox()
|
|||
function showImage(id)
|
||||
{
|
||||
point = pointsSources[id];
|
||||
photos = [];
|
||||
|
||||
if( typeof($('.fotorama').data('fotorama')) != 'undefined' )
|
||||
{
|
||||
$('.fotorama').data('fotorama').destroy();
|
||||
}
|
||||
|
||||
$('#imageModalLabel').text(point.name);
|
||||
$('#imageModalImg').hide();
|
||||
$('.fotorama').show();
|
||||
|
||||
if (typeof(point.images) == 'object')
|
||||
{
|
||||
if( typeof($('.fotorama').data('fotorama')) != 'undefined' )
|
||||
{
|
||||
$('.fotorama').data('fotorama').destroy();
|
||||
}
|
||||
|
||||
$('#imageModalImg').hide();
|
||||
$('.fotorama').show();
|
||||
|
||||
photos = [];
|
||||
point.images.forEach(function(entry) {
|
||||
if (window.devicePixelRatio > 1) {
|
||||
photos.push({img: '/photos/big/'+entry, thumb: '/photos/small/'+entry});
|
||||
|
|
@ -98,13 +98,11 @@ function showImage(id)
|
|||
photos.push({img: '/photos/middle/'+entry, thumb: '/photos/small/'+entry});
|
||||
}
|
||||
});
|
||||
|
||||
initFotorama('.fotorama', photos);
|
||||
} else {
|
||||
$('#imageModalImg').attr('src', point.img);
|
||||
$('#imageModalImg').show();
|
||||
$('.fotorama').hide();
|
||||
photos.push({img: point.img, thumb: point.img});
|
||||
}
|
||||
|
||||
initFotorama('.fotorama', photos);
|
||||
$('#imageModal').modal('show');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue