From 429fb895cfe315d1212c1dc532d35243697d544d Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Wed, 27 May 2015 23:50:34 +0300 Subject: [PATCH] =?UTF-8?q?FIX=20-=20=D1=84=D0=BE=D1=82=D0=BE=D1=80=D0=B0?= =?UTF-8?q?=D0=BC=D0=B0=20=D0=BF=D1=80=D0=B8=20=D0=BE=D0=B4=D0=BD=D0=BE?= =?UTF-8?q?=D0=B9=20=D1=84=D0=BE=D1=82=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/app.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/public/js/app.js b/public/js/app.js index 6fa6487..2d091f9 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -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'); }