jquery-zclip icon indicating copy to clipboard operation
jquery-zclip copied to clipboard

RequireJS fix - issue #1

Open scotthovestadt opened this issue 12 years ago • 4 comments

scotthovestadt avatar Mar 12 '13 19:03 scotthovestadt

@scotthovestadt I have a few reservations about this request because it will on purpose break jslint (not that it passes now, but this would mean it'd never pass) just to 'hack' requirejs, and in the same time defy the purpose of requirejs closures on the source. So I'm not sure if this should be merged. I'm not a RequireJS expert at all, but perhaps it's possible to create the global object inside a requirejs block like below?

var g = this;
requirejs(['jquery-zclip'], function (zclip) { 
  g['ZeroClipboard'] = zclip.ZeroClipboard; 
});

patricklodder avatar Mar 12 '13 20:03 patricklodder

@scotthovestadt I created a patch I'm willing to merge into master at f88cbdf80ecd9b84f208b6fb651ae8132b2f6ca6. Could you please verify if this solves the issue?

patricklodder avatar Mar 12 '13 23:03 patricklodder

Using this version of the library fixed the issues I was having using zclip with RequireJS.

munnja001 avatar Jul 24 '13 15:07 munnja001

Thanks Patrick. I didn't see your previous comments.

scotthovestadt avatar Jul 24 '13 16:07 scotthovestadt