Project

General

Profile

Actions

Feature #40489

open

`copyTextToClipboard` to make it easy to see that you have copied to the clipboard

Added by Abe Tomoaki about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

You can copy the URL of an issue by clicking `Copy Link`, but sometimes you think you have copied it, but you have not.
How about a little popup saying `Copied!` to make it easier to see that it has been copied?

Here is an example of a patch.

diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index 320efd263..12e4aa5d2 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -589,6 +589,28 @@ function randomKey(size) {
   return key;
 }

+function copiedPopup() {
+  $('<div>')
+    .css({
+      position: 'absolute',
+      top: 0,
+      right: 0,
+      bottom: 0,
+      left: 0,
+      margin: 'auto',
+      height: 20,
+      width: 80,
+      'text-align': 'center'
+    })
+    .appendTo(document.body)
+    .text('Copied!')
+    .addClass('ui-state-default')
+    .delay(500)
+    .fadeOut(function() {
+      $(this).remove();
+    });
+}
+
 function copyTextToClipboard(target) {
   if (target) {
     var temp = document.createElement('textarea');
@@ -602,6 +624,7 @@ function copyTextToClipboard(target) {
     if ($(target).closest('.drdn.expanded').length) {
       $(target).closest('.drdn.expanded').removeClass("expanded");
     }
+    copiedPopup()
   }
   return false;
 }

No data to display

Actions

Also available in: Atom PDF