Fix etemplate2 clear instance broken by commit 51394

This commit is contained in:
Hadi Nategh 2015-01-26 14:32:39 +00:00
parent 8c1f3a5386
commit c3a8f0d7c0

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);
}
}
}
};
/**