From c43bc5b98fc51849958e7213ae706c795e803d3a Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 11 Sep 2017 15:43:18 -0400 Subject: [PATCH] LP#1708951: fix tabbing in webstaff catalog app for Firefox This patch works around an issue where Firefox appears to require that the iframe for the embedded OPAC not have a null catalog_url value. It also fixes an issue where navigating to the OPAC View tab after retrieving the record with a different default view set would cause it to jump back to that default view... the first time. To test: [1] In the web staff client, retrieve a bib record and set the default view to a tab other than 'OPAC View'. [2] Retrieve another bib by TCN or ID. Note that although the default tab will briefly display, the page will jump over to the OPAC view and display an empty record. [3] Apply the patch and repeat step 2. This time, it should display the record with the current default view. [4] Select the 'OPAC View' tab and verify that it loads the record details page. Signed-off-by: Galen Charlton Signed-off-by: Beth Willis Signed-off-by: Cesar Velez Signed-off-by: Kathy Lussier --- Open-ILS/web/js/ui/default/staff/cat/catalog/app.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js index faa0954b5c..69526606e8 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js @@ -541,7 +541,7 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e $scope.$apply(); if (!$scope.in_opac_call) { - if ($scope.record_id) { + if ($scope.record_id && !$scope.record_tab) { $scope.default_tab = egCore.hatch.getLocalItem( 'eg.cat.default_record_tab' ); tab = $routeParams.record_tab || $scope.default_tab || 'catalog'; } else { @@ -1717,10 +1717,15 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e // ------------------------------------------------------------------ // Initialize the selected tab + // we explicitly initialize catalog_url because otherwise Firefox + // ends up setting it to $BASE_URL/{{url}}, which then messes + // things up. See LP#1708951 + $scope.catalog_url = ''; + function init_cat_url() { // Set the initial catalog URL. This only happens once. // The URL is otherwise generated through user navigation. - if ($scope.catalog_url) return; + if ($scope.catalog_url) return; var url = $location.absUrl().replace(/\/staff.*/, '/opac/advanced'); -- 2.43.2