##// END OF EJS Templates
Added dynamic followers counter change after toggle following action
marcink -
r1070:f52aab02 beta
parent child Browse files
Show More
@@ -264,7 +264,7
264 <span class="icon_short">
264 <span class="icon_short">
265 <img src="${h.url("/images/icons/heart.png")}" alt="${_('Followers')}" />
265 <img src="${h.url("/images/icons/heart.png")}" alt="${_('Followers')}" />
266 </span>
266 </span>
267 <span class="short">${c.repository_followers}</span>
267 <span id="current_followers_count" class="short">${c.repository_followers}</span>
268 </a>
268 </a>
269 </li>
269 </li>
270 <li>
270 <li>
@@ -351,13 +351,25 var YUE = YAHOO.util.Event;
351 function onSuccess(target){
351 function onSuccess(target){
352
352
353 var f = YUD.get(target.id);
353 var f = YUD.get(target.id);
354 var f_cnt = YUD.get('current_followers_count');
355
354 if(f.getAttribute('class')=='follow'){
356 if(f.getAttribute('class')=='follow'){
355 f.setAttribute('class','following');
357 f.setAttribute('class','following');
356 f.setAttribute('title',"${_('Stop following this repository')}");
358 f.setAttribute('title',"${_('Stop following this repository')}");
359
360 if(f_cnt){
361 var cnt = Number(f_cnt.innerHTML)+1;
362 f_cnt.innerHTML = cnt;
363 }
364
357 }
365 }
358 else{
366 else{
359 f.setAttribute('class','follow');
367 f.setAttribute('class','follow');
360 f.setAttribute('title',"${_('Start following this repository')}");
368 f.setAttribute('title',"${_('Start following this repository')}");
369 if(f_cnt){
370 var cnt = Number(f_cnt.innerHTML)+1;
371 f_cnt.innerHTML = cnt;
372 }
361 }
373 }
362 }
374 }
363
375
General Comments 0
You need to be logged in to leave comments. Login now