aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPriyansh <[email protected]>2021-12-09 01:41:29 -0500
committerPriyansh <[email protected]>2021-12-09 01:41:29 -0500
commitbcffbef170d9ed5850e7a3693e528cdc6f97eb7a (patch)
tree14b5848640f6902524e0b4d5f9232b181907b86e
parentf7891739d704a8dda2f44fe152eca45aef8e8396 (diff)
downloadtemp_pred_arima-bcffbef170d9ed5850e7a3693e528cdc6f97eb7a.tar.xz
temp_pred_arima-bcffbef170d9ed5850e7a3693e528cdc6f97eb7a.zip
adding city ids to the frontend
-rw-r--r--static/js/search.js1
-rw-r--r--templates/index.html1
2 files changed, 2 insertions, 0 deletions
diff --git a/static/js/search.js b/static/js/search.js
index 4b9f3a2..05ddb8c 100644
--- a/static/js/search.js
+++ b/static/js/search.js
@@ -14,6 +14,7 @@ citySearch.addEventListener('keyup', (e) => {
listElement.classList.add('flex', 'items-center', 'space-x-2', 'py-2', 'px-4', 'relative', 'w-full', 'hover:bg-blue-600', 'hover:text-white', 'cursor-pointer');
listElement.setAttribute('latitude', result.item.latitude);
listElement.setAttribute('longitude', result.item.longitude);
+ listElement.setAttribute('cityId', result.item.cityId);
listElement.innerHTML = `<span class="text-sm font-semibold">${result.item.city}</span>`;
listElement.addEventListener('click', (e) => {
citySearch.value = e.target.innerText;
diff --git a/templates/index.html b/templates/index.html
index 19fc873..ac2d321 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -74,6 +74,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script type="text/javascript">
const cities = JSON.parse('{{cities_list | tojson}}');
+ console.log(cities);
</script>
<script src="../static/js/map.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>