From: Galen Charlton Date: Tue, 20 Oct 2015 19:39:10 +0000 (+0000) Subject: webstaff: keep $scope.{pre,suf}fix as acnp/acns objects X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f8699ee46f3b708850063a1fda93aebf7cb97a08;p=evergreen%2Fmasslnc.git webstaff: keep $scope.{pre,suf}fix as acnp/acns objects Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js index 6902a18ad9..b70f81f0cc 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js @@ -426,10 +426,14 @@ function(egCore , $q) { if (angular.isObject(currentPrefix)) currentPrefix = currentPrefix.id(); itemSvc.get_prefixes($scope.callNumber.owning_lib()).then(function(list){ $scope.prefix_list = list; - $scope.prefix = $scope.prefix_list.filter(function (p) { + var newPrefixId = $scope.prefix_list.filter(function (p) { return p.id() == currentPrefix; })[0] || -1; - if ($scope.prefix != currentPrefix) { + if (newPrefixId.id) newPrefixId = newPrefixId.id(); + $scope.prefix = $scope.prefix_list.filter(function (p) { + return p.id() == newPrefixId; + })[0]; + if ($scope.newPrefixId != currentPrefix) { $scope.callNumber.prefix($scope.prefix); } }); @@ -437,10 +441,14 @@ function(egCore , $q) { if (angular.isObject(currentSuffix)) currentSuffix = currentSuffix.id(); itemSvc.get_suffixes($scope.callNumber.owning_lib()).then(function(list){ $scope.suffix_list = list; - $scope.suffix = $scope.suffix_list.filter(function (s) { + var newSuffixId = $scope.suffix_list.filter(function (s) { return s.id() == currentSuffix; })[0] || -1; - if ($scope.suffix != currentSuffix) { + if (newSuffixId.id) newSuffixId = newSuffixId.id(); + $scope.suffix = $scope.suffix_list.filter(function (s) { + return s.id() == newSuffixId; + })[0]; + if ($scope.newSuffixId != currentSuffix) { $scope.callNumber.suffix($scope.suffix); } });