You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by jm...@apache.org on 2016/06/30 05:37:10 UTC

[16/32] incubator-guacamole-client git commit: GUACAMOLE-55: Define wait period before clipboard reads with a documented constant.

GUACAMOLE-55: Define wait period before clipboard reads with a documented constant.

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/058665e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/058665e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/058665e1

Branch: refs/heads/master
Commit: 058665e1f5d9affb8e21b0376646c91884c9e967
Parents: 942fd5d
Author: Michael Jumper <mj...@apache.org>
Authored: Tue Jun 28 16:10:03 2016 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jun 28 16:10:03 2016 -0700

----------------------------------------------------------------------
 .../webapp/app/clipboard/services/clipboardService.js | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/058665e1/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 d157816..94c31c3 100644
--- a/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js
+++ b/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js
@@ -33,6 +33,18 @@ angular.module('clipboard').factory('clipboardService', ['$injector',
     var service = {};
 
     /**
+     * The amount of time to wait before actually serving a request to read
+     * clipboard data, in milliseconds. Providing a reasonable delay between
+     * request and read attempt allows the cut/copy operation to settle, in
+     * case the data we are anticipating to be present is not actually present
+     * in the clipboard yet.
+     *
+     * @constant
+     * @type Number
+     */
+    var CLIPBOARD_READ_DELAY = 100;
+
+    /**
      * Reference to the window.document object.
      *
      * @private
@@ -399,7 +411,7 @@ angular.module('clipboard').factory('clipboardService', ['$injector',
             originalElement.focus();
             popSelection();
 
-        }, 100);
+        }, CLIPBOARD_READ_DELAY);
 
         return deferred.promise;
     };