diff --git a/kallithea/public/js/base.js b/kallithea/public/js/base.js --- a/kallithea/public/js/base.js +++ b/kallithea/public/js/base.js @@ -439,18 +439,17 @@ var show_changeset_tooltip = function(){ var _onSuccessFollow = function(target){ var $target = $(target); var $f_cnt = $('#current_followers_count'); - if($target.hasClass('follow')){ - $target.attr('class', 'following'); - $target.attr('title', _TM['Stop following this repository']); - if($f_cnt.html()){ + if ($target.hasClass('follow')) { + $target.removeClass('follow').addClass('following'); + $target.prop('title', _TM['Stop following this repository']); + if ($f_cnt.html()) { var cnt = Number($f_cnt.html())+1; $f_cnt.html(cnt); } - } - else{ - $target.attr('class', 'follow'); - $target.attr('title', _TM['Start following this repository']); - if($f_cnt.html()){ + } else { + $target.removeClass('following').addClass('follow'); + $target.prop('title', _TM['Start following this repository']); + if ($f_cnt.html()) { var cnt = Number($f_cnt.html())-1; $f_cnt.html(cnt); } diff --git a/kallithea/templates/base/base.html b/kallithea/templates/base/base.html --- a/kallithea/templates/base/base.html +++ b/kallithea/templates/base/base.html @@ -97,13 +97,6 @@ <%def name="repo_context_bar(current=None, rev=None)"> <% rev = None if rev == 'tip' else rev %> <% - def follow_class(): - if c.repository_following: - return h.literal('following') - else: - return h.literal('follow') - %> - <% def is_current(selected): if selected == current: return h.literal('class="current"') @@ -176,10 +169,10 @@ ## also it feels like a job for the controller %if c.authuser.username != 'default':