mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 23:15:48 +01:00
fixed bug where middle-click didn't work on firefox. Now ajaxify is capturing both onclick and mouseup
This commit is contained in:
@@ -69,10 +69,11 @@ var ajaxify = {};
|
|||||||
}
|
}
|
||||||
|
|
||||||
ajaxify.enable = function() {
|
ajaxify.enable = function() {
|
||||||
|
$('a').unbind('mouseup', ajaxify.onmouseup).bind('mouseup', ajaxify.onmouseup);
|
||||||
$('a').unbind('click', ajaxify.onclick).bind('click', ajaxify.onclick);
|
$('a').unbind('click', ajaxify.onclick).bind('click', ajaxify.onclick);
|
||||||
}
|
}
|
||||||
|
|
||||||
ajaxify.onclick = function(ev) {
|
ajaxify.onmouseup = function(ev) {
|
||||||
if (this.href == window.location.href + "#") return;
|
if (this.href == window.location.href + "#") return;
|
||||||
var url = this.href.replace(rootUrl +'/', '');
|
var url = this.href.replace(rootUrl +'/', '');
|
||||||
|
|
||||||
@@ -84,6 +85,10 @@ var ajaxify = {};
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ajaxify.onclick = function(ev) {
|
||||||
|
ev.preventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
$('document').ready(function() {
|
$('document').ready(function() {
|
||||||
if (!window.history || !window.history.pushState) return; // no ajaxification for old browsers
|
if (!window.history || !window.history.pushState) return; // no ajaxification for old browsers
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user