LP1803584: Fix Clear button in template editor user/dpearl/lp1803584-copy-edit-template-clear-signoff
authorJason Boyer <jboyer@library.in.gov>
Thu, 15 Nov 2018 18:45:44 +0000 (13:45 -0500)
committerDan Pearl <dpearl@cwmars.org>
Fri, 24 May 2019 18:52:40 +0000 (14:52 -0400)
There are multiple controllers in staff/cat/volcopy/ and
2 of them have a clearWorking() function. The template
editor controller is referencing $scope.MultiMap[] which
will never exist in the template editor, while the actual
item editor controller clearWorking() does not reference
$scope.MultiMap[], meaning that clearing multiple items
at once would not work as expected. This branch clears
up this confusion.

Signed-off-by: Jason Boyer <jboyer@library.in.gov>
Signed-off-by: Beth Willis <willis@noblenet.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Dan Pearl <dpearl@cwmars.org>
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index 287524c..8bfe70b 100644 (file)
@@ -1416,6 +1416,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
 
         $scope.clearWorking = function () {
             angular.forEach($scope.working, function (v,k,o) {
+                $scope.working.MultiMap[k] = [];
                 if (!angular.isObject(v)) {
                     if (typeof v != 'undefined')
                         $scope.working[k] = undefined;
@@ -2565,7 +2566,6 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
 
                 $scope.clearWorking = function () {
                     angular.forEach($scope.working, function (v,k,o) {
-                        $scope.working.MultiMap[k] = [];
                         if (!angular.isObject(v)) {
                             if (typeof v != 'undefined')
                                 $scope.working[k] = undefined;