From faa3924734f1cb603b88b798c9ea7652a0313054 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 25 Apr 2013 19:24:49 +0000 Subject: [PATCH] prevent scripts in tpls from being executed more than once --- public/src/ajaxify.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index 0e881f0da2..59263bbd70 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -8,6 +8,7 @@ var ajaxify = {}; content = null; var current_state = null; + var executed = {}; ajaxify.go = function(url, callback) { var url = url.replace(/\/$/, ""); @@ -22,7 +23,10 @@ var ajaxify = {}; jQuery('#content, #footer').fadeOut(150, function() { //content.innerHTML = templates[tpl_url]; load_template(function() { - exec_body_scripts(content); + if (executed[url] !== true) { + exec_body_scripts(content); + executed[url] = true; + } ajaxify.enable(); if (callback) {