guillaumepotier/Parsley.js — pull request #275 by shanebonham (2013-06-12 19:12:58+00:00)
Title: Prevent animated error removal from trying to remove `ul` twice

In `removeError()` we check to see if animation is enabled. If it is,
we fade out the message, and the callback removes it, then checks to
see if the `ul` is empty and can also be removed. If animation is not
enabled, we just remove the `li`. After all of this, we check to see if
the `ul` is empty (even though this was already checked if animation is
enabled), and if it is, we remove it.

The problem with this is that if animation is enabled, there may still
be error `li`s that are fading in, but they are not yet detected, and
the entire `ul` is removed because of that second check.

This code moves that second `ul` length check into the else of the
preceding conditional, thus ensuring that it will only happen if
animation is not enabled.