GUAC-810: Resize client display depending only on containing element, not entire window.

This commit is contained in:
Michael Jumper
2014-12-20 16:01:06 -08:00
parent f55c3561a4
commit 50d5a79031
4 changed files with 48 additions and 6 deletions

View File

@@ -115,6 +115,13 @@ angular.module('client').directive('guacClient', [function guacClient() {
*/
var main = $element[0];
/**
* The element which functions as a detector for size changes.
*
* @type Element
*/
var resizeSensor = $element.find('.resize-sensor')[0];
/**
* Guacamole mouse event object, wrapped around the main client
* display.
@@ -491,8 +498,8 @@ angular.module('client').directive('guacClient', [function guacClient() {
$scope.clientProperties.scale = $scope.clientProperties.minScale;
});
// If the window is resized, attempt to resize client
$window.addEventListener('resize', function onResizeWindow() {
// If the element is resized, attempt to resize client
resizeSensor.contentWindow.addEventListener('resize', function mainElementResized() {
// Send new display size, if changed
if (client && display) {