Problem/Motivation
Many adaptive websites rely on javascript code which listens on the window resize event to align content correctly. When the toolbar is shown or hidden, these events are not triggered and parts of the page may break.
I marked this ticket as major bug since this can cause confusion for editors and non-tech users. It might also result in false bug reports.
Proposed resolution
Trigger the resize event on the window object.
$(window).trigger('resize');
Remaining tasks
- Create patch
- Discuss if we might add other events like scroll
User interface changes
Adaptive websites will look way better when using the toolbar tray.
API changes
None
Data model changes
None
Comments
Comment #2
axe312 commentedComment #3
axe312 commentedComment #4
axe312 commentedComment #5
nod_The window is not resizing when interacting with the toolbar, we wouldn't want to be liars.
We do have a way to let code react to toolbar messing around: that's why we have the drupalViewportOffsetChange event firing on
document. We have that exact use case in core. Open Views UI, open a modal and play with the toolbar. It uses the event above to do it's magic, see dialog.position.js.Comment #6
axe312 commentedFriday evening madness. Sorry, forgot to implement the script. It works!
This might be useful for somebody else, here is how I fixed the issue by using the drupalViewportOffsetChange event:
Comment #7
axe312 commented