clipboard: Update clipboard to v2.0.0 to avoid variable name conflict.

It turns out, now we have a new standard way to access clipboard by
`Clipboard` method and currently this conflict with the constructor
exported by clipboard package. The new update v2.0.0 was released to address
this issue. The new version just exports the constructor as `ClipboardJS`.

Ref: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard
Ref: https://github.com/zenorocha/clipboard.js/issues/468
This commit is contained in:
Priyank
2018-04-05 21:45:12 +00:00
committed by Tim Abbott
parent d03d2808b2
commit f5acbcb4c8
5 changed files with 19 additions and 19 deletions

View File

@@ -59,7 +59,7 @@ function init_email_clipboard() {
var copy_email_icon = email_el.find('i');
copy_email_icon.removeClass('hide_copy_icon');
var copy_email_clipboard = new Clipboard(copy_email_icon[0]);
var copy_email_clipboard = new ClipboardJS(copy_email_icon[0]);
copy_email_clipboard.on('success', copy_email_handler);
}
});
@@ -830,7 +830,7 @@ exports.register_click_handlers = function () {
e.preventDefault();
});
new Clipboard('.copy_link');
new ClipboardJS('.copy_link');
$('body').on('click', '.copy_link', function (e) {
popovers.hide_actions_popover();