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/javascripts/application.js

40 lines
1.2 KiB
JavaScript
Raw Normal View History

// This is a manifest file that'll be compiled into including all the files listed below.
2011-08-20 14:54:07 +00:00
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require_tree .
// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
$(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);
});
});