/
home
/
obinna
/
html
/
cravings
/
public
/
js
/
Upload File
HOME
document.addEventListener('DOMContentLoaded', function(){ function loadLocation(loc) { address.value = loc.address document.getElementById('longitude').value = loc.longitude document.getElementById('latitude').value = loc.latitude return true; } // document.querySelector('.get-location').addEventListener('click', function(e){ // e.preventDefault(); // const target = e.currentTarget; // const initial = target.innerHTML; // target.innerHTML = '<i class="fa fa-circle-notch fa-spin"></i>'; // startMap() // .then(loadLocation) // .then(flag => target.innerHTML = initial) // .catch(error => console.log(error)) // }); // document.querySelector('#place-search').addEventListener('focus', function(e){ // const placeSearch = this; // autoComplete({ // input: placeSearch, // fetch: async function(text, update) { // document.querySelector('.place-load').style.display = 'block' // text = text.toLowerCase(); // var response = await $.get(`/api/place/search/${text}`) // var suggestions = response.filter(n => n.name.toLowerCase().includes(text)) // update(suggestions); // document.querySelector('.place-load').style.display = 'none'; // }, // onSelect: function(item) { // placeSearch.value = item.name; // } // }); // }); });