This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/assets/Archive/javascripts/side_bar_history.js

40 lines
874 B
JavaScript
Raw Normal View History

var history_edited = false;
$('#back_main a.reload').live('click',
function () {
$.getScript(this.href);
history.replaceState(null, document.title, this.href);
history_edited = true;
return false;
}
);
2012-05-22 06:45:49 +00:00
$('#back_main form').live('submit', function () {
$.post(this.action, $(this).serialize(), null, 'script');
history_edited = true;
return false;
});
$(document).on('click', '.js_history',
function () {
$.getScript(this.href);
history.pushState(null, document.title, this.href);
history_edited = true;
return false;
}
);
$(document).on('click', '.pagination a',
function () {
$.getScript(this.href);
history.pushState(null, document.title, this.href);
history_edited = true;
return false;
}
);
$(window).bind("popstate", function () {
if (history_edited) {
$.getScript(location.href);
}
});