When using the IPE, if you click "Cancel" at the bottom of the page instead of saving, the next time you customize, the Save/Cancel buttons will not disappear as expected when you click a Settings button for an existing pane, or the Add button to add a new pane. This could lead to the Save/Cancel button being pressed when the Add or Settings modal is still open, which is confusing and might cause unexpected results in what's saved for panes or the display.
Versions in use:
- Drupal core 7.53
- CTools 7.x-1.12+8-dev
- Panels 7.x-3.8+0-dev
Setup:
- Log in as user 1 or as an admin with full permissions.
- Enable latest dev versions of CTools, Page Manager, Panels, and the Panels IPE.
- Create a Page Manager page with a Panels variant; set its renderer to IPE.
- Add some pane content to the page.
To reproduce:
- Browse to and reload the Page Manager page.
- Click the IPE Customize... button.
- Click the settings (gear icon) button for one of the panes.
- Note the settings modal appears and the IPE buttons at the bottom of the screen disappear.
- Close the modal.
- Click the IPE Cancel button.
- Click the IPE Customize... button again.
- Click the settings (gear icon) button for one of the panes.
- Note the settings modal appears, but the IPE buttons do not disappear.
- Reload the page.
- Click the IPE Customize... button.
- Click the settings (gear icon) button for one of the panes.
- Note the settings modal appears and the IPE buttons at the bottom of the screen disappear.
There is a JS function that switches the IPE div from display:block to display:none and back again when a modal opens/closes. If you customize after canceling, the switch doesn't happen. But if you save instead of canceling, or if you reload the page after canceling, the switch happens and everything works as expected.
Comment | File | Size | Author |
---|---|---|---|
#2 | panels-ipe-bar-not-hiding-2841709-2.patch | 1.11 KB | dsnopek |
Comments
Comment #2
dsnopekHere's a patch that works in my testing!
The problem was that it wasn't re-binding the "hide bar" events after restoring the IPE's old state from a cloned copy of the original DOM.
Comment #3
cboyden CreditAttribution: cboyden commentedThanks @dsnopek, after applying this patch the IPE buttons are disappearing when you re-customize after canceling.
Comment #4
DamienMcKennaComment #6
japerryThanks for the patch, looks good to me. Fixed!