Closed hannesfostie closed 10 years ago
I took the liberty of changing the wiki page to reflect the change to the constructor I mentioned
Thanks On 26 Aug 2013 16:11, "Hannes Fostie" notifications@github.com wrote:
I took the liberty of changing the wiki page to reflect the change to the constructor I mentioned
— Reply to this email directly or view it on GitHubhttps://github.com/HaNdTriX/zeroclipboard-rails/issues/7#issuecomment-23269320 .
Hi,
Same issue here: TypeError: clip.getHTML is not a function
Any idea ?
Same here,
Uncaught TypeError: Object [object Object] has no method 'getHTML' application.js?body=1:60
(anonymous function) application.js?body=1:60
jQuery.event.dispatch jquery.js?body=1:5096
elemData.handle
Does this gem work with Turbolinks? The wiki article advises to use zclip gem, but the zclip gem advises to use this one. It's slightly confusing.
The wiki article is obsolete. It tried to solve an position problem, caused by an outdated Version of zeroclipboard. Since then a lot has changed so you should by able to include zeroclipboard as shown in the README.
Please do not try to use the method mentioned in the wiki.
I just removed the misleading wiki-page.
@HaNdTriX - thanks
Thanks for clearing that up @HaNdTriX
My problem was being caused by the fact that my clipboard appears in the multi-step form where users can go back and forward between pages. Turbolinks was causing some problems for visitors returning to a page that already had ZeroClipboard objects initialised.
So I just disabled turbolinks on the page in question and now it works fine.
@murdoch I haven't used rails in awhile. But did you try to remove ZeroClipboard when the page get's unloaded?
Not Tested:
// a Turbolinks-enabled link has been clicked
document.addEventListener("page:before-change", function(){
ZeroClipboard.destroy();
});
// the page has been parsed and changed to the new version and on DOMContentLoaded
document.addEventListener("page:change", function(){
// reinit zeroclipboard here
});
more info on: https://github.com/zeroclipboard/zeroclipboard/issues/54
Hi
Just tried using your gem together with the code example at https://github.com/HaNdTriX/zeroclipboard-rails/wiki/zeroclipboard-rails---jQuery-Examples
First remark is that clip = new ZeroClipboard.Client(); should be changed to new ZeroClipboard(); as per https://github.com/zeroclipboard/ZeroClipboard/pull/65
After doing so however, I am getting an error on line 12 of the file:
It seems getHTML can not be called on clip. I'm at a loss as my javascript skills are very limited. Any idea what's happening?