Remove extra DOM query

This is utterly insignificant but it seems to me to be ever so slightly more tidy to use the cached reference to  `$doc` instead of wrapping it in jQuery again with `$(document)`.