Ensure that secondary state class is assigned to header.

We relied on a transitionend event to fire and trigger the class
assignment, now we force if it hasn't happend until a certain time
DOM refactor