zeroclipboard/jquery.zeroclipboard

How to set swfPath

robdecker opened this issue · 2 comments

When using the regular ZeroClipboard library, I can do something like this:

ZeroClipboard.config({swfPath: '/a/path/to/zeroclipboard/dist/ZeroClipboard.swf'});

How do I do that with jquery.zeroclipboard?

Are you certain that you need to explicitly set this value? ZeroClipboard (and "jquery.zeroclipboard") are setup to infer that the SWF file is located in the same directory as whatever JS file the ZeroClipboard definition is contained within. That covers the vast majority of consumers' situations but anyone who hosts the SWF file is a different location does still need to configure it.

Although not documented [because I wanted to discourage people from configuring it unnecessarily], setting it as follows should work:

$.event.special.copy.options.swfPath = '/a/path/to/zeroclipboard/dist/ZeroClipboard.swf';

Had the same issue. Your solution works for me.
Perhaps it would be handy to include it in the documentation or the Github wiki.