webstaff: Allow UIs wrapping the opac to call functions in the opac iframe
authorMike Rylander <mrylander@gmail.com>
Wed, 11 Mar 2015 20:56:23 +0000 (16:56 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Wed, 19 Aug 2015 17:39:13 +0000 (13:39 -0400)
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/web/js/ui/default/staff/cat/catalog/app.js

index 77a8f08..c6487e2 100644 (file)
@@ -125,6 +125,15 @@ function($scope , $routeParams , $location , $q , egCore , egHolds,
     // set record ID on page load if available...
     $scope.record_id = $routeParams.record_id;
 
+    if ($routeParams.record_id) $scope.from_route = true;
+    else $scope.from_route = false;
+
+    // will hold a ref to the opac iframe
+    $scope.opac_iframe = null;
+    $scope.opac_call = function (thing) {
+        if ($scope.opac_iframe) $scope.opac_iframe.contentWindow[thing]()
+    }
+
     // Set the "last bib" cookie, if we have that
     if ($scope.record_id)
         egCore.hatch.setLocalItem("eg.cat.last_record_retrieved", $scope.record_id);