Dialog windows open conditionally

Migrated to `dialogs.js`.