Fix Javascript animation not shown when there is a flash message