Changeset - ed2fa8b1ccca
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2013-01-28 23:51:59
marcin@python-works.com
disallow triggering repo size action more than once after loading
1 file changed with 10 insertions and 8 deletions:
0 comments (0 inline, 0 general)
rhodecode/public/js/rhodecode.js
Show inline comments
 
@@ -373,56 +373,58 @@ var toggleFollowingUser = function(targe
 
        	onSuccessFollow(target);
 
        }
 
    },args);
 
    return false;
 
}
 

	
 
var toggleFollowingRepo = function(target,fallows_repo_id,token,user_id){
 

	
 
    args = 'follows_repo_id='+fallows_repo_id;
 
    args+= '&auth_token='+token;
 
    if(user_id != undefined){
 
        args+="&user_id="+user_id;
 
    }
 
    YUC.asyncRequest('POST',TOGGLE_FOLLOW_URL,{
 
        success:function(o){
 
        	onSuccessFollow(target);
 
        }
 
    },args);
 
    return false;
 
}
 

	
 
var showRepoSize = function(target, repo_name, token){
 
    var args= 'auth_token='+token;
 
    
 
    // start loading
 
    YUD.get(target).innerHTML = _TM['loading...'];
 
    var url = REPO_SIZE_URL.replace('__NAME__', repo_name);
 
    YUC.asyncRequest('POST',url,{
 
        success:function(o){
 
        	YUD.get(target).innerHTML = JSON.parse(o.responseText);
 
        }
 
    },args);
 
    if(!YUD.hasClass(target, 'loaded')){
 
        YUD.get(target).innerHTML = _TM['loading...'];
 
        var url = REPO_SIZE_URL.replace('__NAME__', repo_name);    	
 
        YUC.asyncRequest('POST',url,{
 
            success:function(o){
 
            	YUD.get(target).innerHTML = JSON.parse(o.responseText);
 
            	YUD.addClass(target, 'loaded');
 
            }
 
        },args);    	
 
    }
 
    return false;	
 
}
 

	
 
/**
 
 * TOOLTIP IMPL.
 
 */
 
YAHOO.namespace('yuitip');
 
YAHOO.yuitip.main = {
 

	
 
	$:			YAHOO.util.Dom.get,
 

	
 
	bgColor:	'#000',
 
	speed:		0.3,
 
	opacity:	0.9,
 
	offset:		[15,15],
 
	useAnim:	false,
 
	maxWidth:	600,
 
	add_links:	false,
 
	yuitips:    [],
 

	
 
	set_listeners: function(tt){
 
		YUE.on(tt, 'mouseover', yt.show_yuitip,  tt);
 
		YUE.on(tt, 'mousemove', yt.move_yuitip,  tt);
 
		YUE.on(tt, 'mouseout',  yt.close_yuitip, tt);		
0 comments (0 inline, 0 general)