Change filter to js with history for bulletins

This commit is contained in:
Christophe Vilayphiou committed 2012-04-07 00:20:52 +08:00
1 parent 253f4bcb54
commit 963a0cb604
8 files changed
+114 -65

No files matched your search

+2 -1
View File
@@ -12,4 +12,5 @@
//= require orbit-1.0
//= require tinymce-jquery
//= require tinymce_orbit
//= require orbit-bar-search
//= require orbit-bar-search
//= require side_bar_history
+44 -26
View File
@@ -1,31 +1,49 @@
$(function () {
$('#back_sidebar a, #back_main a.nav').live('click',
function () {
$.getScript(this.href);
history.pushState(null, document.title, this.href);
history_edited = true;
return false;
}
);
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;
}
);
$('.form').live('submit', function () {
$.post(this.action, $(this).serialize(), null, 'script');
$('#back_sidebar a, #back_main a.nav').live('click',
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);
}
});
$('#back_main a.reload').live('click',
function () {
$.getScript(this.href);
history.replaceState(null, document.title, this.href);
history_edited = true;
return false;
}
);
$('.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);
}
});