From: Galen Charlton Date: Tue, 1 Sep 2015 18:44:11 +0000 (+0000) Subject: webstaff: check that control set loaded before loading record into MARC editor X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=14554202c66931a2db463202cd5cfe1680174313;p=evergreen%2Ftadl.git 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 Signed-off-by: Jason Stephenson --- 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') {