orbit-basic/app/assets/javascripts/side_bar_history.js

26 lines
626 B
JavaScript
Raw Normal View History

$(function () {
$('#panel_sidebar a, #panel_main a.nav').live('click',
function () {
$.getScript(this.href);
history.pushState(null, document.title, this.href);
return false;
}
);
$('#panel_main a.reload').live('click',
function () {
$.getScript(this.href);
history.replaceState(null, document.title, this.href);
return false;
}
);
$('.form').live('submit', function () {
$.post(this.action, $(this).serialize(), null, 'script');
return false;
});
$(window).bind("popstate", function () {
$.getScript(location.href);
});
});