Fixed Bug: copy to clipboard uses pathname

This commit is contained in:
Majed6 2021-03-18 16:48:53 +03:00
parent 4960891bd9
commit 8796c46810
No known key found for this signature in database
GPG key ID: 124583A4A21A70DC
2 changed files with 2 additions and 1 deletions

View file

@ -12,7 +12,6 @@ template(name="cardDetails")
a.fa.fa-link.card-copy-button.js-copy-link(
class="fa-link"
title="{{_ 'copy-card-link-to-clipboard'}}"
value="{{ originRelativeUrl }}"
)
if isMiniScreen
a.fa.fa-times-thin.close-card-details-mobile-web.js-close-card-details

View file

@ -291,6 +291,8 @@ BlazeComponent.extendComponent({
},
'click .js-copy-link'() {
StringToCopyElement = document.getElementById('cardURL_copy');
StringToCopyElement.value =
window.location.origin + window.location.pathname;
StringToCopyElement.select();
if (document.execCommand('copy')) {
StringToCopyElement.blur();