Merge pull request #3661 from Majed6/copy_href

Fixed Bug: copy to clipboard uses pathname
This commit is contained in:
Lauri Ojansivu 2021-03-18 17:41:47 +02:00 committed by GitHub
commit 23e349d277
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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();