You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by vn...@apache.org on 2017/09/04 00:43:47 UTC

[3/5] incubator-guacamole-client git commit: GUACAMOLE-310: Switch clipboard service back to using textarea for contents.

GUACAMOLE-310: Switch clipboard service back to using textarea for contents.

Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/535b70fd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/535b70fd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/535b70fd

Branch: refs/heads/master
Commit: 535b70fdce8ff5df2405e23b30897f65ecda66bf
Parents: 96e9318
Author: Michael Jumper <mj...@apache.org>
Authored: Tue Aug 29 11:38:05 2017 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Sun Sep 3 17:08:34 2017 -0700

----------------------------------------------------------------------
 .../main/webapp/app/clipboard/services/clipboardService.js  | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/535b70fd/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js b/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js
index f0529d8..ff626ea 100644
--- a/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js
+++ b/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js
@@ -57,10 +57,9 @@ angular.module('clipboard').factory('clipboardService', ['$injector',
      *
      * @type Element
      */
-    var clipboardContent = document.createElement('div');
+    var clipboardContent = document.createElement('textarea');
 
     // Ensure clipboard target is selectable but not visible
-    clipboardContent.setAttribute('contenteditable', 'true');
     clipboardContent.className = 'clipboard-service-target';
 
     // Add clipboard target to DOM
@@ -167,7 +166,7 @@ angular.module('clipboard').factory('clipboardService', ['$injector',
 
         // Copy the given value into the clipboard DOM element
         if (typeof data.data === 'string')
-            clipboardContent.textContent = data.data;
+            clipboardContent.value = data.data;
         else {
             clipboardContent.innerHTML = '';
             var img = document.createElement('img');
@@ -400,7 +399,7 @@ angular.module('clipboard').factory('clipboardService', ['$injector',
             pushSelection();
 
             // Clear and select the clipboard DOM element
-            clipboardContent.innerHTML = '';
+            clipboardContent.value = '';
             clipboardContent.focus();
             selectAll(clipboardContent);
 
@@ -431,7 +430,7 @@ angular.module('clipboard').factory('clipboardService', ['$injector',
                 else
                     deferred.resolve(new ClipboardData({
                         type : 'text/plain',
-                        data : clipboardContent.textContent
+                        data : clipboardContent.value
                     }));
 
             }