mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 15:35:47 +01:00
prevent scripts in tpls from being executed more than once
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user