reatlat / wp-campaign-url-builder

WordPress plugin - Generates links for Analytics tools and short link. Enter your Campaign Name, Source, Medium (UTM link) etc. to generate a full link and a short link (trough the Bitly URL Shortener API) all in once.
https://wordpress.org/plugins/campaign-url-builder/
GNU General Public License v3.0
17 stars 4 forks source link

ClipboardJS redeclare event listner #31

Open reatlat opened 5 years ago

reatlat commented 5 years ago

New version ClipBoardJS override my on-click events have to be fixed with callback events

var clipboard = new ClipboardJS('.btn');

clipboard.on('success', function(e) {
    console.info('Action:', e.action);
    console.info('Text:', e.text);
    console.info('Trigger:', e.trigger);

    e.clearSelection();
});

clipboard.on('error', function(e) {
    console.error('Action:', e.action);
    console.error('Trigger:', e.trigger);
});