fix($animate): ensure enable/disable animations work when the document node is used

Closes #4669