Skip to content

Commit cde10f2

Browse files
authored
Merge pull request #2 from fromholdio/fixes/long-url-clipping
FIX - use anchor element href rather than innerHTML
2 parents d9a8e1c + 231263d commit cde10f2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

js/cms.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
$.entwine('copybutton', function($) {
33
$('.field.urlsegment .btn.copy').entwine({
44
onclick: function() {
5-
var url = document.getElementsByClassName('URL-link')[0].innerHTML;
5+
var url = document.getElementsByClassName('URL-link')[0].href;
6+
url = url.replace('?stage=Stage', '');
67
navigator.clipboard.writeText(url)
78
.then(() => {
89
console.log("Text copied to clipboard...")
@@ -13,4 +14,4 @@
1314
}
1415
});
1516
});
16-
}(jQuery));
17+
}(jQuery));

0 commit comments

Comments
 (0)