Closed aemylt closed 7 years ago
Both of these comments have now been addressed.
I think you still need to merge the PR yourself if you want these changes added, instead of simply approving it. Unless someone else has write access to this repo.
Merged! This is great. Sorry it took me a while, have a relatively new 👶. I had a quick look at adding tooltips but I couldn't see the option. Is it built in?
That's fine; kids are definitely more important than this PR. =)
Tooltips aren't built in to the library, but clipboard.js supports success and error events: https://clipboardjs.com/#events
Their recommendation for browser support is to provide a "Copied!" message on a success event and "Press Ctrl+C to copy" on an error event.
Fixes #2
Implemented using clipboard.js, so no Flash is used.
I've also added a brief sentence pointing out the feature. I haven't mentioned browser support right now, so let me know if you want that added. The list of browsers which support clipboard.js is available here.
You can also do more advanced things like displaying tooltips when copying has/hasn't been successful, but I just wanted to show off the basic functionality in this PR.