mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
Merge pull request #73 from glyptodon/mobile-issues
GUAC-956: Fix display and text input rendering on iOS 7.
This commit is contained in:
@@ -31,8 +31,8 @@ angular.module('client').directive('guacViewport', [function guacViewport() {
|
|||||||
scope: {},
|
scope: {},
|
||||||
transclude: true,
|
transclude: true,
|
||||||
templateUrl: 'app/client/templates/guacViewport.html',
|
templateUrl: 'app/client/templates/guacViewport.html',
|
||||||
controller: ['$scope', '$window', '$document', '$element',
|
controller: ['$scope', '$interval', '$window', '$document', '$element',
|
||||||
function guacViewportController($scope, $window, $document, $element) {
|
function guacViewportController($scope, $interval, $window, $document, $element) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The fullscreen container element.
|
* The fullscreen container element.
|
||||||
@@ -69,7 +69,7 @@ angular.module('client').directive('guacViewport', [function guacViewport() {
|
|||||||
var scrollHeight = document.body.scrollHeight;
|
var scrollHeight = document.body.scrollHeight;
|
||||||
|
|
||||||
// Calculate new height
|
// Calculate new height
|
||||||
var adjustedHeight = $window.innerHeight - scrollTop;
|
var adjustedHeight = scrollHeight - scrollTop;
|
||||||
|
|
||||||
// Only update if not in response to our own call to scrollTo()
|
// Only update if not in response to our own call to scrollTo()
|
||||||
if (scrollLeft !== scrollWidth && scrollTop !== scrollHeight
|
if (scrollLeft !== scrollWidth && scrollTop !== scrollHeight
|
||||||
@@ -84,14 +84,22 @@ angular.module('client').directive('guacViewport', [function guacViewport() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Manually attempt scroll if height has not been adjusted
|
||||||
|
else if (adjustedHeight === 0)
|
||||||
|
$window.scrollTo(scrollWidth, scrollHeight);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Fit container within visible region when window scrolls
|
// Fit container within visible region when window scrolls
|
||||||
$window.addEventListener('scroll', fitVisibleArea);
|
$window.addEventListener('scroll', fitVisibleArea);
|
||||||
|
|
||||||
// Clean up event listener on destroy
|
// Poll every 10ms, in case scroll event does not fire
|
||||||
|
var pollArea = $interval(fitVisibleArea, 10);
|
||||||
|
|
||||||
|
// Clean up on destruction
|
||||||
$scope.$on('$destroy', function destroyViewport() {
|
$scope.$on('$destroy', function destroyViewport() {
|
||||||
$window.removeEventListener('scroll', fitVisibleArea);
|
$window.removeEventListener('scroll', fitVisibleArea);
|
||||||
|
$interval.cancel(pollArea);
|
||||||
});
|
});
|
||||||
|
|
||||||
}]
|
}]
|
||||||
|
@@ -21,15 +21,17 @@
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Resize sensor -->
|
|
||||||
<iframe class="resize-sensor" src="app/client/templates/blank.html"></iframe>
|
|
||||||
|
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
<div class="displayOuter">
|
<div class="displayOuter">
|
||||||
|
|
||||||
|
<!-- Resize sensor -->
|
||||||
|
<iframe class="resize-sensor" src="app/client/templates/blank.html"></iframe>
|
||||||
|
|
||||||
<div class="displayMiddle">
|
<div class="displayMiddle">
|
||||||
<div class="display software-cursor">
|
<div class="display software-cursor">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
Reference in New Issue
Block a user