Problem/Motivation

In certain situation there's huge gap between page is loaded(behaviors ran) and shadowbox starts function.
Mostly it happens on pages with lot of media content, easy way to reproduce is to add images with broken links on page.

Normally shadowbox listens to DOMContentLoaded event to add listeners for processed links. However, it seems that running Shadowbox.init inside behavior is too late: though event is not yet triggered, listeners are not executed and shadowbox loads only on window.load event.

Proposed resolution

Attached patch provides new setting, that allows to load shadowbox inside behavior right after setup.

CommentFileSizeAuthor
shadowbox-immediate_load.patch1.7 KBTemoor
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Temoor’s picture