Prior to #1741498: Add a mobile preview bar to Drupal core, Drupal.behaviors.contextualToolbar.attach() adds core that listens to drupalOverlayOpen and drupalOverlayClose events, and after that issue, that also listens to drupalResponsivePreviewStarted and drupalResponsivePreviewStopped events. Let's generalize this so that contrib modules can add other kinds of similar page modals without needing to hack core.
↧