From: Mike Rylander Date: Mon, 27 Apr 2015 16:18:40 +0000 (-0400) Subject: webstaff: Only make the iframe bigger, never smaller X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=66db4076c712403a1ada3faf02c30b4c953dffb5;p=evergreen%2Fmasslnc.git webstaff: Only make the iframe bigger, never smaller Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- 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(); + }); + } } });