The `blur` event does not bubble, but the `focusout` events are not
available in all supported versions of Firefox.
Rather than switching event, this patch using event capture to
effectively achieve the same result and bubble the event up through the
DOM to the delegated listener.
There should be no functional change with this patch, except to support
Firefox fully.
It was preventing JS click event handlers being reached on some
elements, such as course admin items in Classic
(eg download course content for teachers).
With this change the modal can be configured to be scrollable or not.
If enabled to be 'scrollable', the modal's body will become scrollable
when the modal's height exceeds the browser's height. This is useful
in cases where the content in the modal is quite large and extends the
modal beyond the browser's height, which usually results in a bad UI.
If 'scrollable' is not explicitely configured, it will be set as 'true'
by default as in most cases it would be the expected behaviour.
Some browsers like Firefox are very inflexible with window.open()
and block it if it is not instantly invoked after the user click.
Also according to https://stackoverflow.com/a/6807615 it is best
practice to replace self:: with static::
With the templaterev issue resolved we should enable the prefetch module
when cachejs is enabled to avoid a different experience when cachejs is
enabled vs. disabled.
Previously there was little point in doing this due to a range of other
bugs (string normalisation, and misuse of templaterev).
With these issues resolved we should enabel the caching.
The M.cfg.templaterev variable should only be used to present persistent
caching, not caching of content within the same page load.
Preventing caching of same-page content makes it difficult to develop
for real user experiences as content is slow to load and does not give a
realistic and consistent loading experience.
This change affects the loading of partials specifically which notably
includes the loading spinner. Without this patch the loading icon is
often not seen at all because it does not load in a timely fashion and
the content being loaded is loaded first.