committed fix to ajaxify that caused any newly appended anchors to not be

ajaxified
v1.18.x
Julian Lam 12 years ago
parent 4edc1cd3ea
commit 413dc2c0f0

@ -19,7 +19,7 @@ var ajaxify = {};
content.innerHTML = templates[tpl_url];
exec_body_scripts(content);
ajaxify.enableAll();
}
return true;
@ -28,22 +28,25 @@ var ajaxify = {};
return false;
}
$('document').ready(function() {
if (!window.history || !window.history.pushState) return; // no ajaxification for old browsers
content = content || document.getElementById('content');
ajaxify.enableAll = function() {
$('a').unbind('click', ajaxify.enable).bind('click', ajaxify.enable);
}
$('a').unbind('click').bind('click', function(ev) {
ajaxify.enable = function(ev) {
var url = this.href.replace(rootUrl +'/', '');
if (ajaxify.go(url)) {
ev.preventDefault();
return false;
}
}
$('document').ready(function() {
if (!window.history || !window.history.pushState) return; // no ajaxification for old browsers
content = content || document.getElementById('content');
});
ajaxify.enableAll();
});
function exec_body_scripts(body_el) {
@ -54,8 +57,7 @@ var ajaxify = {};
// Argument body_el is an element in the dom.
function nodeName(elem, name) {
return elem.nodeName && elem.nodeName.toUpperCase() ===
name.toUpperCase();
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
};
function evalScript(elem) {

Loading…
Cancel
Save