Skip to content
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.

Commit

Permalink
Ajax : always display the result , remove error message
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Apr 7, 2012
1 parent 08f257e commit 7a0837d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions includes/js/springbok.ajax.js
Expand Up @@ -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')){
Expand All @@ -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($('<p/>').attr('class','message error')
.text(i18nc.Error+(textStatus?' ['+textStatus+']':'')+(errorThrown?' : '+errorThrown:''))).append(jqXHR.responseText);//.fadeTo(150,1);
divPage=divVariable=divContent=false;
}
}*/
});
}
};
Expand Down

0 comments on commit 7a0837d

Please sign in to comment.