MDL-69086 theme_boost: Improve pendingJs checks for bootstrap
commitc2724bce31b8b28e4515dce0f713c2311be7f30e
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 18 Jun 2020 11:19:41 +0000 (18 19:19 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Fri, 19 Jun 2020 00:17:45 +0000 (19 08:17 +0800)
tree13eeb01f0b8b7e6a0bb59afc335b1d35f3995394
parent4762e10fb0f7da5bc37755a4f1426fcf08334f72
MDL-69086 theme_boost: Improve pendingJs checks for bootstrap

Where an element, like an `alert`, is closed it is removed from the DOM
before the event fires (this is a correct behaviour).

This means that the final event confirming that the action happened
(i.e. close => closed) fires, but does not bubble up the DOM to the
document.body.

This change moves the end event listener to only be added after a start
event has been fired, and to attach directly to the HTMLElement where it
will be fired. This means that the Event handler will still be called,
even though it has been removed from the DOM, because it does not need
to bubble up to the body.
theme/boost/amd/build/pending.min.js
theme/boost/amd/src/pending.js