From fb665b409c0447137b31a6cd67d2eded0a0d7db3 Mon Sep 17 00:00:00 2001 From: SBD Date: Thu, 30 Nov 2023 14:04:30 +0300 Subject: [PATCH] 0.8.440 --- static/js/user_profile.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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' + });