Closed garris closed 9 years ago
The short answer is, not in one method. But it is pretty simple to do manually.
Assuming you are starting with something like this...
$tremulaContainer = $('.tremulaContainer');
var tremula = new Tremula();
var config = tremulaConfigs.default.call(tremula);
tremula.init($tremulaContainer,config,this);
You can then do this...
tremula.Grid.removeAll(); //removes all DOM bindings and references
tremula = null; //removes reference to the tremula object
$tremulaContainer.remove(); //removes parent DOM and any associated listeners.
tremula.Grid.removeAll();
does most of the work. I should double check if Hammer.js requires anything special -- I think the remove() method should do it though. If I find anything else I will note it here.
Someone recently asked how to unload tremula -- IOW is there a tremula.destroy() method?