jmuehlner commented on code in PR #796:
URL: https://github.com/apache/guacamole-client/pull/796#discussion_r1119279778


##########
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js:
##########
@@ -49,19 +49,37 @@ angular.module('clipboard').directive('guacClipboard', 
['$injector',
 
         /**
          * The DOM element which will contain the clipboard contents within the
-         * user interface provided by this directive.
+         * user interface provided by this directive. We populate the clipboard
+         * editor via this DOM element rather than updating a model so that we
+         * are prepared for future support of rich text contents.
          *
          * @type Element
          */
-        var element = $element[0];
+        var element = $element[0].querySelector('.clipboard');
+
+        /**
+         * When isActive is set to true then the Clipboard data will be
+         * displayed in the Clipboard Editor. When false, the Clipboard Editor
+         * will not be displayed with Clipboard data.
+         *
+         * @type Boolean
+         */
+        $scope.isActive = false;
+
+        /**
+         * Updates clipboard editor to be active.
+         */
+        $scope.setActive = function setActive() {
+            $scope.isActive = true
+        };
 
         /**
          * Rereads the contents of the clipboard field, updating the
          * ClipboardData object on the scope as necessary. The type of data
          * stored within the ClipboardData object will be heuristically
          * determined from the HTML contents of the clipboard field.
          */
-        var updateClipboardData = function updateClipboardData() {
+        const updateClipboardData = function updateClipboardData() {

Review Comment:
   I'm a fan of using `const` over `var` for this sort of thing for sure - but 
since no actual changes were made to this function, we should just leave it 
unchanged as much as possible - to ensure clean git history. Same with the 
removal of line 105 below. Let's just leave things the way they were.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to