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


##########
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js:
##########
@@ -71,6 +89,32 @@ angular.module('clipboard').directive('guacClipboard', 
['$injector',
 
         };
 
+        /**
+         * Allows Clipboard Editor to begin displaying clipboard data, reads 
the
+         * clipboard data and updates the content of the clipboard editor to 
the
+         * given data.
+         */
+        var displayAndUpdateClipboardEditor = function 
displayAndUpdateClipboardEditor() { 
+            isActive = true;
+            element.value = ''
+            element.classList.remove("inactive");
+
+            clipboardService.getClipboard().then((data) => {
+                updateClipboardEditor(data);
+            }, angular.noop);
+        };
+
+        /**
+         * Prevent the Clipboard Editor from displaying clipboard data.
+         */
+        var hideAndUpdateClipboardEditor = function 
hideAndUpdateClipboardEditor() { 

Review Comment:
   This entire function probably doesn't need to exist - all this can be done 
directly in the template with conditional rendering depending on the value of 
`isActive`.



-- 
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