Ensures that only the target dialog is opened when a dialog link is clicked.