sync
[roojs1] / roojs-core-debug.js
index 6f85f91..02931da 100644 (file)
@@ -14513,17 +14513,20 @@ Roo.extend(Roo.util.ClickRepeater, Roo.util.Observable, {
  * 
  **/
 Roo.util.Clipboard = {
-    
-    write : function(textToCopy) {
+    /**
+     * Writes a string to the clipboard - using the Clipboard API if https, otherwise using text area.
+     * @param {String} text to copy to clipboard
+     */
+    write : function(text) {
         // navigator clipboard api needs a secure context (https)
         if (navigator.clipboard && window.isSecureContext) {
             // navigator clipboard api method'
-            navigator.clipboard.writeText(textToCopy);
+            navigator.clipboard.writeText(text);
             return ;
         } 
         // text area method
         var ta = document.createElement("textarea");
-        ta.value = textToCopy;
+        ta.value = text;
         // make the textarea out of viewport
         ta.style.position = "fixed";
         ta.style.left = "-999999px";