"Copy link" feature for issue and issue journal (#34703).

Patch by Mizuki ISHIKAWA.


git-svn-id: http://svn.redmine.org/redmine/trunk@20816 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2021-03-18 03:58:29 +00:00
parent 06ac3473e0
commit 44ea826a21
10 changed files with 109 additions and 13 deletions

View File

@@ -563,6 +563,23 @@ function randomKey(size) {
return key;
}
function copyTextToClipboard(target) {
if (target) {
var temp = document.createElement('textarea');
temp.value = target.getAttribute('data-clipboard-text');
document.body.appendChild(temp);
temp.select();
document.execCommand('copy');
if (temp.parentNode) {
temp.parentNode.removeChild(temp);
}
if ($(target).closest('.drdn.expanded').length) {
$(target).closest('.drdn.expanded').removeClass("expanded");
}
}
return false;
}
function updateIssueFrom(url, el) {
$('#all_attributes input, #all_attributes textarea, #all_attributes select').each(function(){
$(this).data('valuebeforeupdate', $(this).val());