From 35bfe9736021d12088412c7272d8108586ccb42e Mon Sep 17 00:00:00 2001 From: mrilyew <99399973+mrilyew@users.noreply.github.com> Date: Sun, 8 Dec 2024 11:45:19 +0300 Subject: [PATCH] fix(ajax): fix #1169, fix #1172 --- Web/Presenters/templates/User/View.xml | 2 +- Web/static/js/router.js | 7 ++++++- Web/static/js/utils.js | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Web/Presenters/templates/User/View.xml b/Web/Presenters/templates/User/View.xml index f3eca4ce..10801053 100644 --- a/Web/Presenters/templates/User/View.xml +++ b/Web/Presenters/templates/User/View.xml @@ -132,7 +132,7 @@ {/if} {_send_gift} - {_send_message} + {_send_message} {var $subStatus = $user->getSubscriptionStatus($thisUser)} {if $subStatus === 0} diff --git a/Web/static/js/router.js b/Web/static/js/router.js index 44c317b5..3be9b7e1 100644 --- a/Web/static/js/router.js +++ b/Web/static/js/router.js @@ -152,7 +152,7 @@ window.router = new class { return false } - if(!url || url == '' || url == '/') { + if(!url || url == '') { return false } @@ -275,6 +275,11 @@ u(document).on('click', 'a', async (e) => { return } + // temporary fix + if(dom_url == '/') { + url = url + 'id0' + } + e.preventDefault() console.log(`AJAX | Going to URL ${url}`) diff --git a/Web/static/js/utils.js b/Web/static/js/utils.js index 95c25fe3..56614757 100644 --- a/Web/static/js/utils.js +++ b/Web/static/js/utils.js @@ -229,6 +229,11 @@ function serializeForm(form, submitter = null) } } break + case 'radio': + if(inp.checked) { + fd.append(inp.name, inp.value) + } + break } })