Committing code for the close button functioning.

refs #31471