On 2/11/20 10:27 AM, Ross Thomas wrote:
> Looking into it here.

Yep.  I've been bitten by this before. :-p

The onClick handler needs to return the result of the called function.
A fix patch is attached for illustration as it affects both this
enhancement and stable/default.

Ross.
diff -r 0c6914676f88 kallithea/templates/base/base.html
--- a/kallithea/templates/base/base.html	Fri Feb 07 14:16:39 2020 -0800
+++ b/kallithea/templates/base/base.html	Tue Feb 11 11:13:43 2020 -0800
@@ -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>
diff -r 0c6914676f88 kallithea/templates/data_table/_dt_elements.html
--- a/kallithea/templates/data_table/_dt_elements.html	Fri Feb 07 14:16:39 2020 -0800
+++ b/kallithea/templates/data_table/_dt_elements.html	Tue Feb 11 11:13:43 2020 -0800
@@ -63,7 +63,7 @@
   ## N.B. Same reservations as expressed in base.html (from whence this came)
   %if request.authuser.username != 'default':
     ## NOTE:  Needs to be one line or 'space' link rendered after icon
-    <a href="#" class="${'following' if repo_following else 'follow'}" onclick="toggleFollowingRepo(this, ${repo_id});"><i class="list-quick-actions icon-heart-empty show-follow" title="${_('Follow')}"></i><i class="list-quick-actions icon-heart show-following" title="${_('Unfollow')}"></i></a>
+    <a href="#" class="${'following' if repo_following else 'follow'}" onclick="return toggleFollowingRepo(this, ${repo_id});"><i class="list-quick-actions icon-heart-empty show-follow" title="${_('Follow')}"></i><i class="list-quick-actions icon-heart show-following" title="${_('Unfollow')}"></i></a>
 
     <a href="${h.url('repo_fork_home',repo_name=repo_name)}" title="${_('Fork')}"><i class="icon-fork"></i></a>
   %endif
_______________________________________________
kallithea-general mailing list
[email protected]
https://lists.sfconservancy.org/mailman/listinfo/kallithea-general

Reply via email to