Complement onShow with onHide

Like `onShow`, adding an `onHide` method that is called before `onClose` is executed.