Delay collapse animation

By adding a timeout and delaying the collapse / expand in the next render loop, it allows the content to be correctly measured and therefore, the animation appears to be less sluggish.