Passing in jQuery object doesn't work #121

Closed
frabcus opened this Issue Mar 20, 2013 · 2 comments

Projects

None yet

2 participants

@frabcus
frabcus commented Mar 20, 2013

The documentation says you can do this:

new ZeroClipboard($("#d_clip_button"), { moviePath: "new/path", text: "Copy me!" })

It doesn't work - if using jQuery we've found we have to get the underlying DOM object, e.g. by doing [0]:

new ZeroClipboard($("#d_clip_button")[0], { moviePath: "new/path", text: "Copy me!" })

Either the documentation needs updating to make it clear it needs a DOM element, or the code changing to detect jQuery objects.

@JamesMGreene
Member

What version are you using? This should work just fine since v1.1.6 (so v1.1.6, v1.1.7, and current master so far) as it just loops through the array.

v1.1.6:
https://github.com/jonrohan/ZeroClipboard/blob/v1.1.6/src/javascript/ZeroClipboard/event.js#L104

@JamesMGreene
Member

Closing unless the OP can provide more proof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment