FIX галереи

This commit is contained in:
Krivchikov Dmitry 2014-08-12 11:04:21 +04:00
parent 2780454977
commit 40cda40db8
3 changed files with 9 additions and 4 deletions

View File

@ -9,9 +9,6 @@
<img src="" id="imageModalImg" style="max-width: 555px; max-height: 450px;" /> <img src="" id="imageModalImg" style="max-width: 555px; max-height: 450px;" />
<div class="fotorama" data-loop="true" data-auto="false" maxwidth="555" maxheight="450" ></div> <div class="fotorama" data-loop="true" data-auto="false" maxwidth="555" maxheight="450" ></div>
</div> </div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">OK</button>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -81,6 +81,11 @@ function showImage(id)
if (typeof(point.images) == 'object') if (typeof(point.images) == 'object')
{ {
if( typeof($('.fotorama').data('fotorama')) != 'undefined' )
{
$('.fotorama').data('fotorama').destroy();
}
$('#imageModalImg').hide(); $('#imageModalImg').hide();
$('.fotorama').show(); $('.fotorama').show();

View File

@ -171,7 +171,10 @@ function showInfo(id)
pointsSources[id] = data; pointsSources[id] = data;
if (typeof(data.images) == 'object') if (typeof(data.images) == 'object')
{ {
ph = '';
if (data.images.length > 1)
ph = '<div class="photosCount"><span class="glyphicon glyphicon-camera"></span> <b>+' + (data.photosCount-1) + '</b></div>'; ph = '<div class="photosCount"><span class="glyphicon glyphicon-camera"></span> <b>+' + (data.photosCount-1) + '</b></div>';
ph += '<img src="/photos/small/' + data.img + '" onclick="showImage(\''+ id +'\')" />'; ph += '<img src="/photos/small/' + data.img + '" onclick="showImage(\''+ id +'\')" />';
} }
else else