dom/transitionEnd: slight refactor

Avoiding creating functions as much as possible.