Find selectors with-in context of container #5

Merged
merged 1 commit into from Oct 21, 2013

Projects

None yet

2 participants

@markcarver
Contributor

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:

var $all = $(selector)

I have the plugin loaded on the actual page (that has jQuery and the plugin). The CKEditor DOM instance (iframe) falls outside the scope of the jQuery document, however. So when I was selecting my elements, it couldn't find the ones inside my CKEditor instance; it would only search the parent DOM. Changing it to the following fixes this:

var $all = $container.find(selector)
@gilmoreorless gilmoreorless merged commit 476d8db into gilmoreorless:master Oct 21, 2013
@gilmoreorless
Owner

Thanks, good catch. I'd added in the container option for position calculations but didn't think about limiting the element selection as well.

@markcarver markcarver deleted the markcarver:patch-1 branch Oct 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment