Fix etemplate2 clear instance broken by commit 51394

This commit is contained in:
Hadi Nategh 2015-01-26 14:33:09 +00:00
parent 0361739045
commit f01cfd4a41

View File

@ -196,6 +196,19 @@ etemplate2.prototype.clear = function()
this.widgetContainer = null;
}
$j(this.DOMContainer).empty();
// Remove self from the index
for(name in this.templates)
{
if(typeof etemplate2._byTemplate[name] == "undefined") continue;
for(var i = 0; i < etemplate2._byTemplate[name].length; i++)
{
if(etemplate2._byTemplate[name][i] == this)
{
etemplate2._byTemplate[name].splice(i,1);
}
}
}
};
/**