Nicolas Bally 8a08ee35c8 initial
2015-02-22 14:36:30 +01:00

50 lines
1.1 KiB
Plaintext

$('#main_content').fadeOut({
complete:function(){
$("#main_content").html('<%=escape_javascript(render(:partial => "index"))%>')
$("#menu_top").html("<%= escape_javascript(render(:partial => "public/shared/first_menu") )%>");
<% if content_for?(:bandeau) %>;
$("#bandeau").html("<%= escape_javascript(render(:partial => "bandeau") )%>");
$("#bandeau").fadeIn()
$("#main").addClass("with_banner");
<% else %>
$("#bandeau").fadeOut()
$("#main").removeClass("with_banner");
<% end %>
var stateObj = { url: "<%=request.fullpath%>" };
if(popstat == false){
history.pushState(stateObj, "", "<%=request.fullpath%>");
}else{
popstat = false;
}
window.onpopstate = function(event) {
popstat= true;
if(event && event.state) {
$.ajax({url:event.state.url,dataType:"script"});
}
}
$('#main').fadeIn(500);
$('#accueil').fadeOut(500);
$('#color_background').fadeIn(500);
$(this).fadeIn(500);
$("#top").removeClass("acceuil");
}
});