Make sure the dialogs are setup after their html has been loaded.

This is still a bit hacky but we are getting there bit by bit.