Add width/height getters, add onresize event.

This commit is contained in:
Michael Jumper
2012-10-24 10:52:53 -07:00
parent 56495c7cfa
commit ea6764743f

View File

@@ -463,6 +463,16 @@ Guacamole.Client = function(tunnel) {
*/ */
this.onclipboard = null; this.onclipboard = null;
/**
* Fired when the default layer (and thus the entire Guacamole display)
* is resized.
*
* @event
* @param {Number} width The new width of the Guacamole display.
* @param {Number} height The new height of the Guacamole display.
*/
this.onresize = null;
// Layers // Layers
function getBufferLayer(index) { function getBufferLayer(index) {
@@ -954,6 +964,10 @@ Guacamole.Client = function(tunnel) {
bounds.style.width = (displayWidth*displayScale) + "px"; bounds.style.width = (displayWidth*displayScale) + "px";
bounds.style.height = (displayHeight*displayScale) + "px"; bounds.style.height = (displayHeight*displayScale) + "px";
// Call resize event handler if defined
if (guac_client.onresize)
guac_client.onresize(width, height);
} }
} }
@@ -1134,6 +1148,14 @@ Guacamole.Client = function(tunnel) {
}; };
this.getWidth = function() {
return displayWidth;
};
this.getHeight = function() {
return displayHeight;
};
this.getScale = function() { this.getScale = function() {
return displayScale; return displayScale;
}; };