diff --git a/ground/views/modals/image.php b/ground/views/modals/image.php index 13a6e39..3b3f31a 100644 --- a/ground/views/modals/image.php +++ b/ground/views/modals/image.php @@ -6,8 +6,7 @@ diff --git a/ground/views/point.php b/ground/views/point.php index eff09db..4de3683 100644 --- a/ground/views/point.php +++ b/ground/views/point.php @@ -32,7 +32,7 @@ img): ?>

-
+
img): ?> diff --git a/public/css/style.css b/public/css/style.css index 3483107..0b9dbcc 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -103,7 +103,6 @@ div#box {background-image: url('/img/back.png'); background-repeat: no-repeat; b .modal-content { width: 100%!important; height: 100%!important; - /*margin: 0!important;*/ } .modal-header { @@ -126,12 +125,17 @@ div#box {background-image: url('/img/back.png'); background-repeat: no-repeat; b } } -/* Target landscape smartphones, portrait tablets, narrow desktops */ -@media screen and (max-width:768px) { -/* .leaflet-popup { - width: 100%!important; - height: 100%!important; - margin: 0!important; - }*/ -} +@media screen and (max-width:815px) { + body { + padding: 0!important; + } + div.container{ + padding: 5px; + } + + div.header a img { + width: 115px; + height: 69px; + } +} diff --git a/public/js/app.js b/public/js/app.js index 05e5108..68d29aa 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1,4 +1,4 @@ -/* +/* * Приложение */ @@ -99,14 +99,12 @@ function showImage(id) } }); - $('.fotorama').fotorama({data: photos}); - } else - { + initFotorama('.fotorama', photos); + } else { + $('#imageModalImg').attr('src', point.img); $('#imageModalImg').show(); $('.fotorama').hide(); - $('#imageModalImg').attr('src', point.img); } - $('#imageModal').modal('show'); } @@ -157,7 +155,7 @@ window.addEventListener('popstate', function(e) lat = e.state.lat; lng = e.state.lng; zoom = e.state.zoom; - + myMap.setView([lat, lng], zoom); } else if (e.state.hasOwnProperty('route')) @@ -441,3 +439,39 @@ function filter() } } +$(document).ready(function(){ + if ($('.dfotorama').length >= 1) { + initFotorama('.dfotorama'); + + $(window).on("orientationchange", function (event) { + $('.dfotorama').data('fotorama').destroy(); + initFotorama('.dfotorama'); + }); + } +}); + +function initFotorama(selector, data){ + width = $(window).width() < 585 ? $(window).width()-10 : 555; + height = $(window).width() < 585 ? ((450/555)*($(window).width()-10)) : 450; + + if($(window).height() < height ) { + height = $(window).height(); + width = (555/450)*height; + } + + width = Math.round(width); + height = Math.round(height); + + if (typeof data !== 'undefined') { + $(selector).fotorama({ + data: data, + width: width, + height: height + }); + } else { + $(selector).fotorama({ + width: width, + height: height + }); + } +} diff --git a/public/js/map.js b/public/js/map.js index fa907f7..d779cff 100644 --- a/public/js/map.js +++ b/public/js/map.js @@ -1,4 +1,4 @@ -/* +/* * Let's GO! */ @@ -214,8 +214,10 @@ function showInfo(id) } description += '
'; + maxWidth = $(window).width() < 500 ? $(window).width() : 500; + maxHeight = $(window).height() < 300 ? $(window).height() : 300; marker.options.description = description; - marker.bindPopup(marker.options.description, {maxWidth: 500, minWidth: 400,maxHeight: 300}); + marker.bindPopup(marker.options.description, {maxWidth: maxWidth, minWidth: 400,maxHeight: maxHeight}); markers.zoomToShowLayer(marker, function () { marker.openPopup(); @@ -236,7 +238,6 @@ function showInfo(id) history.pushState({pointId: id}, document.title, "/?point=" + id); document.title = points[id].options.title; -// marker.openPopup(); } }