Skip to content

Commit

Permalink
fix(ajax): fix #1169, fix #1172
Browse files Browse the repository at this point in the history
  • Loading branch information
mrilyew committed Dec 8, 2024
1 parent efa3e12 commit 35bfe97
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Web/Presenters/templates/User/View.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
{/if}

<a style="width: 194px;" n:if="OPENVK_ROOT_CONF['openvk']['preferences']['commerce'] && $user->getGiftCount() == 0" href="/gifts?act=pick&user={$user->getId()}" class="profile_link">{_send_gift}</a>
<a style="width: 194px;" n:if="$user->getPrivacyPermission('messages.write', $thisUser)" href="/im?sel={$user->getId()}" class="profile_link">{_send_message}</a>
<a style="width: 194px;" n:if="$user->getPrivacyPermission('messages.write', $thisUser)" href="/im?sel={$user->getId()}" class="profile_link" rel="nofollow">{_send_message}</a>

{var $subStatus = $user->getSubscriptionStatus($thisUser)}
{if $subStatus === 0}
Expand Down
7 changes: 6 additions & 1 deletion Web/static/js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ window.router = new class {
return false
}

if(!url || url == '' || url == '/') {
if(!url || url == '') {
return false
}

Expand Down Expand Up @@ -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}`)
Expand Down
5 changes: 5 additions & 0 deletions Web/static/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ function serializeForm(form, submitter = null)
}
}
break
case 'radio':
if(inp.checked) {
fd.append(inp.name, inp.value)
}
break
}
})

Expand Down

0 comments on commit 35bfe97

Please sign in to comment.