prevent scripts in tpls from being executed more than once

v1.18.x
psychobunny 12 years ago
parent 880d6832be
commit faa3924734

@ -8,6 +8,7 @@ var ajaxify = {};
content = null; content = null;
var current_state = null; var current_state = null;
var executed = {};
ajaxify.go = function(url, callback) { ajaxify.go = function(url, callback) {
var url = url.replace(/\/$/, ""); var url = url.replace(/\/$/, "");
@ -22,7 +23,10 @@ var ajaxify = {};
jQuery('#content, #footer').fadeOut(150, function() { jQuery('#content, #footer').fadeOut(150, function() {
//content.innerHTML = templates[tpl_url]; //content.innerHTML = templates[tpl_url];
load_template(function() { load_template(function() {
exec_body_scripts(content); if (executed[url] !== true) {
exec_body_scripts(content);
executed[url] = true;
}
ajaxify.enable(); ajaxify.enable();
if (callback) { if (callback) {

Loading…
Cancel
Save