29 lines
757 B
JavaScript
29 lines
757 B
JavaScript
// Place your application-specific JavaScript functions and classes here
|
|
// This file is automatically included by javascript_include_tag :defaults
|
|
|
|
$(function () {
|
|
$('#sidebar a, #main a.nav').live('click',
|
|
function () {
|
|
$.getScript(this.href);
|
|
history.pushState(null, document.title, this.href);
|
|
return false;
|
|
}
|
|
);
|
|
|
|
$('#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);
|
|
});
|
|
}); |