/
home
/
obinna
/
html
/
cravings
/
public
/
js
/
Upload File
HOME
var food = document.getElementById('food'), address = document.getElementById('address'), longitude = document.getElementById('lngs'), latitude = document.getElementById('lats') const populate = (location) => { address.value = location.address || address.value; longitude.value = location.longitude || longitude.value; latitude.value = location.latitude || latitude.value; } const changeAddress = (e) => { var inp = e.target.value if(inp.length < 8){ longitude.value = ""; latitude.value = ""; } } const handleFoodInput = (e) => { const $target = $(e.currentTarget); if($target.val().length > 2){ search(e, function(result){}) // console.log($target) $target.closest('.form-group').find('span').show(); }else { $target.closest('.form-group').find('span').hide(); } } $('.form-group').on('click', '.fa.fa-times', function(e){ const $target = $(e.currentTarget); $target.hide() $target.closest('.form-group').find('input').val(""); }) // if(food){ // food.addEventListener('keyup', handleFoodInput); // } if(address) address.addEventListener('keyup', changeAddress)