From fed54a5be0a5b90f7a20febaab9825139c3a13c9 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 27 Jul 2015 17:14:06 +0000 Subject: [PATCH] webstaff: teach eg-record-html how to initialize itself from MARCXML Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- .../js/ui/default/staff/cat/services/record.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/record.js b/Open-ILS/web/js/ui/default/staff/cat/services/record.js index 6f79a70b43..a67cb87a10 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/services/record.js +++ b/Open-ILS/web/js/ui/default/staff/cat/services/record.js @@ -1,7 +1,9 @@ /** - * Simple directive for rending the HTML view of a bib record. + * Simple directive for rending the HTML view of a MARC record. * * + * OR + * * * The value of myRecordIdScopeVariable is watched internally and the * record is updated to match. @@ -11,7 +13,10 @@ angular.module('egCoreMod') .directive('egRecordHtml', function() { return { restrict : 'AE', - scope : {recordId : '='}, + scope : { + recordId : '=', + marcXml : '@', + }, link : function(scope, element, attrs) { scope.element = angular.element(element); @@ -28,7 +33,9 @@ angular.module('egCoreMod') egCore.net.request( 'open-ils.search', 'open-ils.search.biblio.record.html', - $scope.recordId + $scope.recordId, + false, + $scope.marcXml ).then(function(html) { if (!html) return; @@ -54,7 +61,7 @@ angular.module('egCoreMod') } ); - if ($scope.recordId) + if ($scope.recordId || $scope.marcXml) loadRecordHtml(); } ] -- 2.43.2