changeset 8235:85135d4f9fef stable

ui: fix page navigation/scrolling when toggling "Follow" status The onclick handler was a void function and thus not cancelling the default handling of following the 'href'. The called toggleFollowingRepo function was already returning false, so the onClick handler just needs to return the result of the called function.
author Ross Thomas <ross@lns-nevasoft.com>
date Wed, 12 Feb 2020 14:37:15 +0100
parents 8169770a4f2c
children 08c0326e9127 b1b1f69b1f28
files kallithea/templates/base/base.html
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/templates/base/base.html	Tue Feb 11 03:34:33 2020 +0100
+++ b/kallithea/templates/base/base.html	Wed Feb 12 14:37:15 2020 +0100
@@ -163,7 +163,7 @@
               ## also it feels like a job for the controller
               %if request.authuser.username != 'default':
                   <li>
-                   <a href="#" class="${'following' if c.repository_following else 'follow'}" onclick="toggleFollowingRepo(this, ${c.db_repo.repo_id});">
+                   <a href="#" class="${'following' if c.repository_following else 'follow'}" onclick="return toggleFollowingRepo(this, ${c.db_repo.repo_id});">
                     <span class="show-follow"><i class="icon-heart-empty"></i>${_('Follow')}</span>
                     <span class="show-following"><i class="icon-heart"></i>${_('Unfollow')}</span>
                    </a>