From 205fb641803fbf37a2332472936b5a1d5d6017d1 Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Mon, 20 Aug 2018 10:42:02 +0300 Subject: [PATCH] =?UTF-8?q?FIX=20-=20=D0=B2=D0=B5=D1=80=D0=BD=D1=83=D0=BB?= =?UTF-8?q?=20=D0=BF=D0=BE=D0=B4=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D1=83=20?= =?UTF-8?q?=D1=82=D0=BE=D1=87=D0=B5=D0=BA=20=D0=BF=D1=80=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B5=20=D0=BC=D0=B0?= =?UTF-8?q?=D1=80=D1=88=D1=80=D1=83=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/app.js | 10 +++------- public/js/map.js | 15 +++++---------- views/article.php | 1 + 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/public/js/app.js b/public/js/app.js index 4516645..19fd1bb 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -147,16 +147,14 @@ window.addEventListener('popstate', function(e) if (e.state.hasOwnProperty('pointId')) { showInfo(e.state.pointId, false, true); - } else - if (e.state.hasOwnProperty('zoom')) + } else if (e.state.hasOwnProperty('zoom')) { lat = e.state.lat; lng = e.state.lng; zoom = e.state.zoom; myMap.setView([lat, lng], zoom); - } else - if (e.state.hasOwnProperty('route')) + } else if (e.state.hasOwnProperty('route')) { loadRouteJSON(e.state.route); } @@ -251,9 +249,7 @@ function activateAddPoint() $('#map').css('cursor', 'crosshair'); $('div#addHelper').slideDown(200); setStatus(statusHunting) - } - else - { + } else { $('div#addHelper').hide(150); $('#map').css('cursor', 'arrow'); setStatus(statusReady) diff --git a/public/js/map.js b/public/js/map.js index d8ba720..5a71fb5 100644 --- a/public/js/map.js +++ b/public/js/map.js @@ -87,8 +87,7 @@ function init(lat, lng) { myMap.on('click', function (e) { if (!myMap._popup) { - if (status == statusHunting) - { + if (status == statusHunting) { $('div#addHelper').hide(150); $('#addPointId').remove(); $('#addPointForm input:text').val(''); @@ -99,8 +98,7 @@ function init(lat, lng) { $('#myModalLabel').text('Добавление новой точки'); $('#addPointModal').modal('show'); - } else if (status == statusReHunting) - { + } else if (status == statusReHunting) { resetStatus(); $('#addPointLat').val(e.latlng.lat); @@ -109,8 +107,7 @@ function init(lat, lng) { $('#myModalLabel').text('Редактирование точки'); $('#addPointModal').modal('show'); } - } - else { + } else { closePopup(); } }); @@ -121,15 +118,13 @@ function init(lat, lng) { $("#extraParamsContainer").sortable(); myMap.on('moveend', function (e) { - if (!myMap._popup && $('#boxRoute').css('display') == 'none' && status != statusMovingInHistory) - { + if (!myMap._popup && status != statusMovingInHistory) { document.title = 'Лучшие выходные — это выходные в путешествии! – wikipoints.ru'; history.pushState({lat: myMap.getCenter().lat, lng: myMap.getCenter().lng, zoom: myMap.getZoom()}, document.title, "/?lat=" + myMap.getCenter().lat + "&lng=" + myMap.getCenter().lng + "&zoom=" + myMap.getZoom()); loadPointsInBounds(); } - if (status == statusMovingInHistory) - { + if (status == statusMovingInHistory) { resetStatus(); } }); diff --git a/views/article.php b/views/article.php index 25526dd..f042864 100644 --- a/views/article.php +++ b/views/article.php @@ -21,6 +21,7 @@ +