Replace ZeroClipboard with Clipboard.js
This commit is contained in:
@@ -1,14 +1,8 @@
|
||||
(function() {
|
||||
var copyButton = document.getElementById('copy-button');
|
||||
if (copyButton) {
|
||||
var data = document.getElementById('example-source').textContent;
|
||||
new ZeroClipboard(copyButton).on('copy', function(event) {
|
||||
event.clipboardData.setData({
|
||||
'text/plain': data,
|
||||
'text/html': data
|
||||
});
|
||||
});
|
||||
}
|
||||
var clipboard = new Clipboard('#copy-button');
|
||||
clipboard.on('success', function(e) {
|
||||
e.clearSelection();
|
||||
});
|
||||
|
||||
var codepenButton = document.getElementById('codepen-button');
|
||||
if (codepenButton) {
|
||||
|
||||
Reference in New Issue
Block a user