Allow changing the overlay mount location
Created by: lguychard
Rel https://github.com/sourcegraph/sourcegraph/issues/3228#issuecomment-481174882
On GitLab merge request pages, the diff tab is always present. As a result, when switching tabs, the hover overlay remains visible, since it is by default mounted to document.body
, and as such is not affected by the change in visibility of the diff tab.
This PR introduces the ability to customize the hover overlay mount location, through CodeHost.getHoverOverlayMountLocation()
. If CodeHost.getHoverOverlayMountLocation()
is unspecified, or if it returns null
, the hover overlay will be mounted to document.body. If the custom mount location is removed from the DOM, the hover overlay will be mounted to document.body again.