From 7a0837d65364a2788ffbc12f7ea821a18b0a1aef Mon Sep 17 00:00:00 2001 From: Christophe Hurpeau Date: Sat, 7 Apr 2012 23:58:49 +0200 Subject: [PATCH] Ajax : always display the result , remove error message --- includes/js/springbok.ajax.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/includes/js/springbok.ajax.js b/includes/js/springbok.ajax.js index 38c3fbbb..44922d5d 100755 --- a/includes/js/springbok.ajax.js +++ b/includes/js/springbok.ajax.js @@ -80,11 +80,11 @@ includeCore('springbok.history'); $.ajax(ajaxurl,{ type:type?type:'GET', data:data, headers:headers, async:false, - complete:function(){ - $('body').removeClass('cursorWait'); + complete:function(jqXHR){ + /* $('body').removeClass('cursorWait'); divLoading.remove(); }, - success:function(data,textStatus,jqXHR){ + success:function(data,textStatus,jqXHR){*/ var h,div,to; if(h=jqXHR.getResponseHeader('SpringbokRedirect')){ @@ -105,20 +105,23 @@ includeCore('springbok.history'); //tinyMCE.execCommand('mceRemoveControl',false,this.id.substr(0,this.id.length-7)) tinyMCE.remove(this.id.substr(0,this.id.length-7)); }); - div.html(data);//.fadeTo(0,1); + div.html(jqXHR.responseText);//.fadeTo(0,1); $(window).scrollTop(0); if(normalFaviconHref) linkFavicon.attr('href',normalFaviconHref); if(to === 'base') divPage=$('#page'); else if(to==='page') divPage.attr('class',jqXHR.getResponseHeader('SpringbokAjaxPageClass')); // if(to === 'base' || to === 'page') S.ajax.updateVariable(divPage); - }, + + $('body').removeClass('cursorWait'); + divLoading.remove(); + }/*, error:function(jqXHR,textStatus,errorThrown){ $(window).scrollTop(0); divContainer.html($('

').attr('class','message error') .text(i18nc.Error+(textStatus?' ['+textStatus+']':'')+(errorThrown?' : '+errorThrown:''))).append(jqXHR.responseText);//.fadeTo(150,1); divPage=divVariable=divContent=false; - } + }*/ }); } };