New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find selectors with-in context of container #5

Merged
merged 1 commit into from Oct 21, 2013

Conversation

Projects
None yet
2 participants
@markcarver
Contributor

markcarver commented Oct 21, 2013

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 added a commit that referenced this pull request Oct 21, 2013

Merge pull request #5 from markcarver/patch-1
Find selectors with-in context of container

@gilmoreorless gilmoreorless merged commit 476d8db into gilmoreorless:master Oct 21, 2013

@gilmoreorless

This comment has been minimized.

Show comment
Hide comment
@gilmoreorless

gilmoreorless Oct 21, 2013

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.

Owner

gilmoreorless commented Oct 21, 2013

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