diff --git a/pages/items.js.php b/pages/items.js.php index 4a4ce17d8..d96d48636 100755 --- a/pages/items.js.php +++ b/pages/items.js.php @@ -1019,6 +1019,20 @@ function(teampassItem) { // // > END < // + } else if ($(this).data('item-action') === 'link') { + // Add link to clipboard. + navigator.clipboard.writeText("/index.php?page=items&group="+store.get('teampassItem').folderId+"&id="+store.get('teampassItem').id); + + // Display message. + toastr.remove(); + toastr.info( + 'get('copy_to_clipboard'); ?>', + '', { + timeOut: 2000, + progressBar: true, + positionClass: 'toast-top-right' + } + ); } return false; @@ -5061,28 +5075,6 @@ function(teampassItem) { // Waiting $('#card-item-attachments').html("get('please_wait'); ?>"); - // Manage clipboard for link - if (clipboardForLink) clipboardForLink.destroy(); - clipboardForLink = new ClipboardJS( - '#get_item_link', - { - text: function(e) { - return ("/index.php?page=items&group="+store.get('teampassItem').folderId+"&id="+store.get('teampassItem').id); - } - }) - .on('success', function(e) { - toastr.remove(); - toastr.info( - 'get('copy_to_clipboard'); ?>', - '', { - timeOut: 2000, - progressBar: true, - positionClass: 'toast-top-right' - } - ); - e.clearSelection(); - }); - // Manage clipboard button if (itemClipboard) itemClipboard.destroy(); itemClipboard = new ClipboardJS('.btn-copy-clipboard-clear', { diff --git a/pages/items.php b/pages/items.php index 2bf525695..cf575b9f9 100755 --- a/pages/items.php +++ b/pages/items.php @@ -589,7 +589,7 @@ get('copy'); ?>