Fixed a couple of things like (locate me, location edit)

This commit is contained in:
=
2019-10-18 03:29:15 -07:00
parent bfb510252b
commit 9b830bdd01
5 changed files with 52 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
const { currentSearchRequest } = require("../helpers/url");
const getLocation = async (req, res) => {
const title = "U kojem naselju tražite nekretninu?";
const title = "Odaberite lokaciju";
const nextStep = req.query.nextStep || "/";
res.render("location", {

View File

@@ -26,7 +26,7 @@ const getQueryReviewData = searchRequest => {
? realEstateTypeObject.title
: "-";
const locationTitle = "Location description - PLACEHOLDER";
const locationTitle = "Promjenite lokaciju";
const sizeTitle = `${sizeMin} - ${sizeMax} m2`;
const gardenSizeTitle = enableGardenSizeEdit
? `${gardenSizeMin} - ${gardenSizeMax} m2`
@@ -39,11 +39,11 @@ const getQueryReviewData = searchRequest => {
title: realEstateTypeTitle,
url: `/vrstanekretnine/${id}?nextStep=filteri`
},
// {
// id: "location",
// title: locationTitle,
// url: `/lokacija/${id}?nextStep=pregled`
// },
{
id: "location",
title: locationTitle,
url: `/lokacija/${id}?nextStep=pregled`
},
{
id: "size",
title: sizeTitle,
@@ -59,7 +59,7 @@ const getQueryReviewData = searchRequest => {
title: priceTitle,
url: `/filteri/${id}?nextStep=pregled`
}
];
].filter((data) => data.title != "-");
};
const getQueryReview = async (req, res) => {

View File

@@ -34,7 +34,8 @@
margin-top: 100px;
}
.btn, .btn-floating {
.btn,
.btn-floating {
background: #02adba;
font-weight: bold;
}
@@ -57,6 +58,7 @@ body {
margin: 0;
padding: 0;
font-family: "Alte Haas Grotesk", serif;
box-sizing: border-box;
}
#floating-panel {
@@ -71,13 +73,24 @@ body {
padding: 5px 5px 5px 10px;
}
.btn:hover {
background-color: white;
color: #02adba;
.btn-floating:hover,
btn:hover {
background-color: #02adba;
border: 1px solid rgb(0, 173, 187);
}
h6.title {
margin-top: 0;
font-weight: bold; padding-top: 20px;
}
font-weight: bold;
padding-top: 20px;
font-size: 1.3rem;
}
.locate-me-container {
margin-right: 10px;
}
h3 {
font-size: 15px;
line-height: 1.5;
}

View File

@@ -50,6 +50,5 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/13.1.5/nouislider.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/wnumb/1.1.0/wNumb.min.js"></script>
</body>
</html>

View File

@@ -1,14 +1,13 @@
<div class="row center-align">
<h3>
Područje na mapi će biti uključeno u pretragu. Namjestite mapu na ulice
koje želite da budu vidljive.
</h3>
</div>
<div class="row center-align">
<div class="col s9 m10 l11 xl11">
<input id="autocompleteInput" placeholder="Lokacija..." type="text" />
</div>
<div class="col s1 m1 l1 xl1">
<a id="locateMe" class="btn-floating waves-effect waves-light"><i class="material-icons right">gps_fixed</i></a>
<div class="col s12 m12 l12 xl12">
<input id="autocompleteInput" placeholder="Unesite grad, naselje ili ulicu..." type="text" />
</div>
</div>
@@ -100,6 +99,26 @@
autocomplete.bindTo('bounds', map);
autocomplete.addListener('place_changed', onPlaceChanged);
pacSelectFirst(inputElement);
addLocateMeButton(map);
}
function addLocateMeButton(map) {
var parent = document.createElement('div');
parent.className = "locate-me-container";
var a = document.createElement('a');
a.id = "locateMe";
a.className = "btn-floating";
var i = document.createElement('i');
i.innerText = "gps_fixed";
i.className = "material-icons right";
a.appendChild(i)
a.addEventListener("click", locateMe);
parent.appendChild(a)
map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(parent)
}
function onPlaceChanged() {
@@ -156,8 +175,7 @@
$("#form-map-output").submit();
});
document.getElementById("locateMe").addEventListener("click", locateMe);
});
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAna8ohfV2HBMcxGk_29vqxU5Z_bDickqg&language=bs&libraries=places&callback=initMap" async
defer></script>
defer></script>