mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +00:00
GUACAMOLE-55: Prevent clipboard events generated by the clipboardService from disturbing the operations of the guacClipboard directive.
This commit is contained in:
@@ -54,6 +54,22 @@ angular.module('clipboard').factory('clipboardService', ['$injector',
|
||||
// Add clipboard target to DOM
|
||||
document.body.appendChild(clipboardContent);
|
||||
|
||||
/**
|
||||
* Stops the propogation of the given event through the DOM tree. This is
|
||||
* identical to invoking stopPropogation() on the event directly, except
|
||||
* that this function is usable as an event handler itself.
|
||||
*
|
||||
* @param {Event} e
|
||||
* The event whose propogation through the DOM tree should be stopped.
|
||||
*/
|
||||
var stopEventPropagation = function stopEventPropagation(e) {
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
||||
// Prevent events generated due to execCommand() from disturbing external things
|
||||
clipboardContent.addEventListener('copy', stopEventPropagation);
|
||||
clipboardContent.addEventListener('paste', stopEventPropagation);
|
||||
|
||||
/**
|
||||
* A stack of past node selection ranges. A range convering the nodes
|
||||
* currently selected within the document can be pushed onto this stack
|
||||
|
Reference in New Issue
Block a user