Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor() {
Dropzone.autoDiscover = false;
this.poll = poll;
new Clipboard('.tms-chat-direct .tms-clipboard')
.on('success', function(e) {
toastr.success('复制到剪贴板成功!');
}).on('error', function(e) {
toastr.error('复制到剪贴板失败!');
});
this.initSubscribeEvent();
}
attached() {
this.getBlog();
new Clipboard('.em-blog-content .tms-clipboard')
.on('success', function(e) {
toastr.success('复制到剪贴板成功!');
}).on('error', function(e) {
toastr.error('复制到剪贴板失败!');
});
$('.em-blog-content').on('click', 'code[data-code]', function(event) {
if (event.ctrlKey) {
event.stopImmediatePropagation();
event.preventDefault();
clipboard.copy($(event.currentTarget).attr('data-code')).then(
() => { toastr.success('复制到剪贴板成功!'); },
(err) => { toastr.error('复制到剪贴板失败!'); }
);
}
});