Javascript fix for collapsible editors