This idea was given to me by my friend David so I can take no credit for it. NB: The MutationObserver will also fire when the hidden class is added to the modal to hide it, so we must detect that in ...