From 56990ef0f67b7a351a108aa45e012c320634119b Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 1 Sep 2015 18:44:11 +0000 Subject: [PATCH] webstaff: check that control set loaded before loading record into MARC editor This seems hacky... but it also seems to work. Signed-off-by: Galen Charlton --- Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js | 13 ++++++++++--- Open-ILS/web/js/ui/default/staff/cat/services/tagtable.js | 5 +++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js index e36fac8c70..f45376aa35 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js +++ b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js @@ -1027,9 +1027,16 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) } ); - if ($scope.recordId || $scope.marcXml) { - loadRecord(); - } + var unregister = $scope.$watch(function() { + return egTagTable.initialized(); + }, function(val) { + if (val) { + unregister(); + if ($scope.recordId || $scope.marcXml) { + loadRecord(); + } + } + }); $scope.mangle_005 = function () { var now = new Date(); diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/tagtable.js b/Open-ILS/web/js/ui/default/staff/cat/services/tagtable.js index 6b40c9cad9..f32b2de27b 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/services/tagtable.js +++ b/Open-ILS/web/js/ui/default/staff/cat/services/tagtable.js @@ -15,10 +15,15 @@ function($q, egCore, egAuth) { ff_pos_map : { }, ff_value_map : { }, authority_control_set : { + _remote_loaded : false, _controlsets : [ ] } }; + service.initialized = function() { + return service.authority_control_set._remote_loaded; + } + // allow 'bre' and 'biblio' to be synonyms, etc. service.normalizeRecordType = function(recordType) { if (recordType === 'sre') { -- 2.11.0