From 0076eef9f54157d5bbaf594a14b7aac0205b0067 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Mon, 20 Apr 2015 16:32:30 -0400 Subject: [PATCH] webstaff: core widgets - teach egEmbedFrame how to not throw warnings, And also, how to be used more than once per app. Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- Open-ILS/src/templates/staff/share/t_eframe.tt2 | 3 +-- Open-ILS/web/js/ui/default/staff/services/eframe.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/templates/staff/share/t_eframe.tt2 b/Open-ILS/src/templates/staff/share/t_eframe.tt2 index 8fc95ca6c6..0562f665a0 100644 --- a/Open-ILS/src/templates/staff/share/t_eframe.tt2 +++ b/Open-ILS/src/templates/staff/share/t_eframe.tt2 @@ -2,8 +2,7 @@ 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 e62806ecdb..fec41b7437 100644 --- a/Open-ILS/web/js/ui/default/staff/services/eframe.js +++ b/Open-ILS/web/js/ui/default/staff/services/eframe.js @@ -23,6 +23,13 @@ angular.module('egCoreMod') templateUrl : './share/t_eframe', + link: function (scope, element, attrs) { + element.find('iframe').on( + 'load', + function() {scope.egEmbedFrameLoader(this)} + ); + }, + controller : ['$scope','$window','$location','$q','$timeout','egCore', function($scope , $window , $location , $q , $timeout , egCore) { @@ -65,9 +72,10 @@ angular.module('egCoreMod') // for porting dojo, etc. apps to angular apps and should // eventually go away. // NOTE: catalog integration is not a stop-gap - $window.egEmbedFrameLoader = function(iframe) { - $scope.frame = iframe; + $scope.egEmbedFrameLoader = function(iframe) { + + $scope.frame = {dom:iframe}; var page = iframe.contentWindow.location.href; console.debug('egEmbedFrameLoader(): ' + page); -- 2.11.0