Add triggers on popup open and close.