Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Closing the shortcuts bar destroys the overlay. Opening it has the same effect.
Steps to reproduce:
1) Click a link that opens an overlay (e.g. "Create content" or any administration link)
2) Close the shortcuts bar (click on the little arrow at the right of the toolbar)
See the overlay vanish, possibly with unsaved content that has been entered.
I filed it on overlay.module but could also be a shortcuts.module or toolbar.module issue, I don't know.
Comment | File | Size | Author |
---|---|---|---|
#2 | Overlay-toolbar-compat.patch | 1.5 KB | Gábor Hojtsy |
Comments
Comment #1
Gábor HojtsyI was immediately about to say this is an issue with toolbar, since it reloads the page with the link. However, without the overlay, it indeed does not reload the page, so it is a problem with the overlay interaction for sure.
Comment #2
Gábor HojtsyOk, the issue here is that we have two click handlers. One in overlay-parent.js:
The other in toolbar.js:
Unfortunately the first runs before the second, so the reload is already started by the time the toolbar can start toggling and trying to stop the event flow. It cannot stop the event that started earlier obviously.
We have a few options to fix this:
- get the toolbar.js run before overlay-parent.js (can be a fragile solution)
- come up with a name and add a class on the toggle link to exclude it from the displace click simulation
- somehow delay that redirect and wait for whether someone else handles the link (sounds bloated)
I picked the second idea I had and put in a preprocess chunk to add a class by the overlay and then skip links with that class in the click handler. Obviously if the toolbar is replaced with something else having similar controls in the toolbar or any bottom bar, they'd need to add this class for similar click-hook links.
With this patch, the toolbar works fine with me with the overlay.
Comment #3
roborn CreditAttribution: roborn commentedConfirmed. The toolbar + overlay works fine with this patch.
Tested on FF3.5 and Chrome3.
Comment #4
mcrittenden CreditAttribution: mcrittenden commentedSub.
Comment #5
webchickCommitted to HEAD. Thanks!