diff --git a/static/js/user_profile.js b/static/js/user_profile.js index 8d5536e..091a402 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -524,15 +524,21 @@ function sendRoute(el, routeID = null){ data: JSON.stringify(obj_w_el_form), success: function(data){ - + let data_route_id = data.route_id // location.href = '/profile' document.querySelector(".info_profile").innerHTML = data.html - let el_route = document.querySelector(`[data-number-of-route="${routeID}"]`); - - el_route.scrollIntoView(true); + let el_route = document.querySelector(`[data-number-of-route="${data_route_id}"]`); + if (routeID){ + el_route = document.querySelector(`[data-number-of-route="${routeID}"]`); + } + el_route.scrollIntoView({ + behavior:"smooth", + block:'nearest', + inline:'nearest' + });