mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
Implement dispose() within LayerContainer.
This commit is contained in:
@@ -722,11 +722,9 @@ Guacamole.Client = function(tunnel) {
|
||||
// If visible layer, remove from parent
|
||||
if (layer_index > 0) {
|
||||
|
||||
// Get container element
|
||||
var layer_container = getLayerContainer(layer_index).getElement();
|
||||
|
||||
// Remove from parent
|
||||
layer_container.parentNode.removeChild(layer_container);
|
||||
var layer_container = getLayerContainer(layer_index);
|
||||
layer_container.dispose();
|
||||
|
||||
// Delete reference
|
||||
delete layers[layer_index];
|
||||
@@ -1556,6 +1554,24 @@ Guacamole.Client.LayerContainer = function(index, width, height) {
|
||||
div.style.opacity = a/255.0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes this layer container entirely, such that it is no longer
|
||||
* contained within its parent layer, if any.
|
||||
*/
|
||||
this.dispose = function() {
|
||||
|
||||
// Remove from parent container
|
||||
if (layer_container.parent) {
|
||||
delete layer_container.parent.children[layer_container.index];
|
||||
layer_container.parent = null;
|
||||
}
|
||||
|
||||
// Remove from parent element
|
||||
if (div.parentNode)
|
||||
div.parentNode.removeChild(div);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Applies the given affine transform (defined with six values from the
|
||||
* transform's matrix).
|
||||
|
Reference in New Issue
Block a user