gilmoreorless/jquery-nearest — pull request #5 by markcarver (2013-10-21 01:39:36+00:00)
Title: Find selectors with-in context of container

I'm using this for a CKEditor plugin and I couldn't for the life of me figure out why I couldn't get this plugin to work. It turns out that the following didn't have any context for where these elements were:
```js
var $all = $(selector)
```
I have the plugin loaded on the actual page (that has jQuery and the plugin). The CKEditor DOM instance doesn't however. So when I was selecting my elements, it couldn't find the ones inside my CKEditor instance; only the ones in the parent DOM. Changing it to the following fixes this:
```js
var $all = $container.find(selector)
```