beforeEnter hook for js transitions