Simplify how we show/hide the overlay #790
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
In #750, we added support for Gutenberg's full screen mode and in the process of that, changed up how the overlay on the distribution menu is used. Main goal there was to be able to capture clicks on the overlay and use that to close the overlay (as well as retain the hover in/out showing and hiding).
After thinking about it a bit more, I thought of a few ways this could be simplified and the results of that are this PR.
This overlay div is now added right after the distributor menu item, so we can use just CSS to show and hide that. This means the overlay should never show unless it's needed, while the current approach can result in the overlay showing if you hover over/out really quickly on the menu item. This also means a lot of code can be removed as it is no longer needed.
We still have one use of
hoverintentthat I would love to get rid of but I couldn't come up with a better approach there. Basically we need to know when someone hovers out of the menu so we can hide the admin bar if in fullscreen mode. Open to thoughts on that piece.Alternate Designs
None
Benefits
Simpler logic around the showing and hiding of the overlay
Possible Drawbacks
None
Verification Process
Same process as described on #750
Checklist:
Applicable Issues
Changelog Entry