From 6ccafc4c93d77c54c8f8aa17e6d15aa0c9e84ee4 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Mon, 27 Apr 2015 12:18:40 -0400 Subject: [PATCH] webstaff: Only make the iframe bigger, never smaller Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton --- Open-ILS/web/js/ui/default/staff/services/eframe.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/services/eframe.js b/Open-ILS/web/js/ui/default/staff/services/eframe.js index 5ef6fec4dd..e312ba6764 100644 --- a/Open-ILS/web/js/ui/default/staff/services/eframe.js +++ b/Open-ILS/web/js/ui/default/staff/services/eframe.js @@ -79,7 +79,8 @@ angular.module('egCoreMod') $scope.iframe = iframe; // Reset the iframe height to the final content height. - $scope.height = $scope.iframe.contentWindow.document.body.scrollHeight; + if ($scope.height < $scope.iframe.contentWindow.document.body.scrollHeight) + $scope.height = $scope.iframe.contentWindow.document.body.scrollHeight; var page = $scope.iframe.contentWindow.location.href; console.debug('egEmbedFrameLoader(): ' + page); @@ -122,11 +123,13 @@ angular.module('egCoreMod') extra = 0; } - $scope.iframe.contentWindow.openils.Util.addOnLoad( function() { - var old_height = $scope.height; - $scope.height = e.scrollHeight + extra; - $scope.$apply(); - }); + if ($scope.height < e.scrollHeight + extra) { + $scope.iframe.contentWindow.openils.Util.addOnLoad( function() { + var old_height = $scope.height; + $scope.height = e.scrollHeight + extra; + $scope.$apply(); + }); + } } }); -- 2.11.0