Try to keep consistent coding style, we use space in if statements, like so:

	if( dialog.preview ) {