See the org.ametys.cms.tool.content.ContentTool.prototype._destroyEditionComponents javascript function in the ContentTool.i18n.js file.