webstaff: core widgets - teach egEmbedFrame how to not throw warnings,
authorMike Rylander <mrylander@gmail.com>
Mon, 20 Apr 2015 20:32:30 +0000 (16:32 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Wed, 19 Aug 2015 17:39:16 +0000 (13:39 -0400)
And also, how to be used more than once per app.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/src/templates/staff/share/t_eframe.tt2
Open-ILS/web/js/ui/default/staff/services/eframe.js

index 8fc95ca..0562f66 100644 (file)
@@ -2,8 +2,7 @@
   <!-- height is calculated at render time -->
   <iframe 
     src="{{url}}" 
-    style="height:{{height}}px"
-    onload="egEmbedFrameLoader(this)">
+    style="height:{{height}}px">
   </iframe>
 </div>
 
index e62806e..fec41b7 100644 (file)
@@ -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);