Changeset - 72c8917108ee
[Not reviewed]
beta
0 1 0
Mads Kiilerich - 13 years ago 2013-03-19 22:50:28
madski@unity3d.com
Transplanted from: 386b345db75c
journal: don't show "error" popup when navigating away from page while lazy info is loading

The "error" box would pop up in the Journal view when quickly pointing and
clicking a link while the info was loading.

This fix might prevent showing valid error messages in some browsers.
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/public/js/rhodecode.js
Show inline comments
 
@@ -404,49 +404,51 @@ function ypjax(url,container,s_call,f_ca
 
    		}
 
		}
 
	})()	
 
	YUD.setStyle(container,'opacity','0.3');
 
	YUC.asyncRequest(method,url,{
 
		success:s_wrapper,
 
		failure:function(o){
 
			console.log(o);
 
			YUD.get(container).innerHTML='<span class="error_red">ERROR: {0}</span>'.format(o.status);
 
			YUD.setStyle(container,'opacity','1.0');
 
		},
 
		cache:false
 
	},args);
 
	
 
};
 

	
 
var ajaxGET = function(url,success) {
 
	// Set special header for ajax == HTTP_X_PARTIAL_XHR
 
	YUC.initHeader('X-PARTIAL-XHR',true);
 

	
 
    var sUrl = url;
 
    var callback = {
 
        success: success,
 
        failure: function (o) {
 
            alert("error");
 
            if (o.status != 0) {
 
                alert("error: " + o.statusText);
 
            };
 
        },
 
    };
 

	
 
    var request = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback);
 
    return request;
 
};
 

	
 

	
 

	
 
var ajaxPOST = function(url,postData,success) {
 
	// Set special header for ajax == HTTP_X_PARTIAL_XHR
 
	YUC.initHeader('X-PARTIAL-XHR',true);
 
	
 
	var toQueryString = function(o) {
 
	    if(typeof o !== 'object') {
 
	        return false;
 
	    }
 
	    var _p, _qs = [];
 
	    for(_p in o) {
 
	        _qs.push(encodeURIComponent(_p) + '=' + encodeURIComponent(o[_p]));
 
	    }
 
	    return _qs.join('&');
 
	};
 
	
0 comments (0 inline, 0 general)