clean up references. destroy editor and listeners when not visible.