So essentially this would need to use the same logic as in _moveToTop that calculates the z-index for the dialog?