// will hold a ref to the opac iframe
$scope.opac_iframe = null;
+ $scope.in_opac_call = false;
$scope.opac_call = function (opac_frame_function, force_opac_tab) {
if ($scope.opac_iframe) {
if (force_opac_tab) $scope.record_tab = 'catalog';
+ $scope.in_opac_call = true;
$scope.opac_iframe.contentWindow[opac_frame_function]();
}
}
if (match) {
$scope.record_id = match[1];
egCore.hatch.setLocalItem("eg.cat.last_record_retrieved", $scope.record_id);
-
- // force the record_id to show up in the page.
- // not sure why a $digest isn't occuring here.
- try { $scope.$apply() } catch(E) {}
} else {
delete $scope.record_id;
}
- if ($scope.record_id) {
- var default_tab = egCore.hatch.getLocalItem( 'eg.cat.default_record_tab' );
- tab = $routeParams.record_tab || default_tab || 'catalog';
+ // child scope is executing this function, so our digest doesn't fire ... thus,
+ $scope.$apply();
+
+ if (!$scope.in_opac_call) {
+ if ($scope.record_id) {
+ var default_tab = egCore.hatch.getLocalItem( 'eg.cat.default_record_tab' );
+ tab = $routeParams.record_tab || default_tab || 'catalog';
+ } else {
+ tab = $routeParams.record_tab || 'catalog';
+ }
+ $scope.set_record_tab(tab);
} else {
- tab = $routeParams.record_tab || 'catalog';
+ $scope.in_opac_call = false;
}
- $scope.set_record_tab(tab);
}
// xulG catalog handlers