fixed bug where middle-click didn't work on firefox. Now ajaxify is capturing both onclick and mouseup

v1.18.x
Julian Lam 12 years ago
parent 1d78c6a35d
commit 6c82ffa09a

@ -69,10 +69,11 @@ var ajaxify = {};
}
ajaxify.enable = function() {
$('a').unbind('mouseup', ajaxify.onmouseup).bind('mouseup', ajaxify.onmouseup);
$('a').unbind('click', ajaxify.onclick).bind('click', ajaxify.onclick);
}
ajaxify.onclick = function(ev) {
ajaxify.onmouseup = function(ev) {
if (this.href == window.location.href + "#") return;
var url = this.href.replace(rootUrl +'/', '');
@ -84,6 +85,10 @@ var ajaxify = {};
}
}
ajaxify.onclick = function(ev) {
ev.preventDefault();
}
$('document').ready(function() {
if (!window.history || !window.history.pushState) return; // no ajaxification for old browsers

Loading…
Cancel
Save