Skip to content
  • Andrew Lyons's avatar
    MDL-69086 theme_boost: Improve pendingJs checks for bootstrap · c2724bce
    Andrew Lyons authored
    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.
    c2724bce