Dialog: refactor into common show/hide logic
dom/transitionEnd: unify transition and nontransition timing

Makes both elements with transition and without happen under a single
promise.