Changeset - f52aab02db29
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 15 years ago 2011-02-19 12:04:49
marcin@python-works.com
Added dynamic followers counter change after toggle following action
1 file changed with 13 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/templates/base/base.html
Show inline comments
 
@@ -264,7 +264,7 @@
 
                    <span class="icon_short">
 
                        <img src="${h.url("/images/icons/heart.png")}" alt="${_('Followers')}" />
 
                    </span>
 
                    <span class="short">${c.repository_followers}</span>
 
                    <span id="current_followers_count" class="short">${c.repository_followers}</span>
 
                    </a>
 
                </li>
 
                <li>
 
@@ -351,13 +351,25 @@ var YUE = YAHOO.util.Event;
 
function onSuccess(target){
 
	
 
	var f = YUD.get(target.id);
 
	var f_cnt = YUD.get('current_followers_count');
 
	
 
    if(f.getAttribute('class')=='follow'){
 
        f.setAttribute('class','following');
 
        f.setAttribute('title',"${_('Stop following this repository')}");
 
        
 
        if(f_cnt){
 
            var cnt = Number(f_cnt.innerHTML)+1;
 
            f_cnt.innerHTML = cnt;
 
        }
 
        
 
    }
 
    else{
 
        f.setAttribute('class','follow');
 
        f.setAttribute('title',"${_('Start following this repository')}");
 
        if(f_cnt){
 
            var cnt = Number(f_cnt.innerHTML)+1;
 
            f_cnt.innerHTML = cnt;
 
        }      
 
    }
 
}
 

	
0 comments (0 inline, 0 general)