From 7417b395d9b790cbcd66914a3884b6a3d248d2e0 Mon Sep 17 00:00:00 2001
From: Cesar Velez <cesar.velez@equinoxinitiative.org>
Date: Thu, 16 Aug 2018 17:40:56 -0400
Subject: [PATCH] LP#1739087 - add [x] to volcopy editor volume rows-FollowUp

Since we're programmatically changing the Volume counter,
must manually trigger the change event, to prevent sync issues.

Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>

Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>
---
 Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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 43a493035f..496b93d808 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
@@ -570,7 +570,7 @@ function(egCore , $q) {
         template:
             '<div class="row">'+
                 '<div class="col-xs-2">'+
-                    '<button style="margin:-5px -15px; float:left;" ng-hide="callNumber.not_ephemeral" type="button" class="close" ng-click="removeCN()">&times;</button>' +
+                    '<button aria-label="Delete" style="margin:-5px -15px; float:left;" ng-hide="callNumber.not_ephemeral" type="button" class="close" ng-click="removeCN()">&times;</button>' +
                     '<select ng-disabled="record == 0" class="form-control" ng-model="classification" ng-change="updateClassification()" ng-options="cl.name() for cl in classification_list"/>'+
                 '</div>'+
                 '<div class="col-xs-1">'+
@@ -770,7 +770,8 @@ function(egCore , $q) {
 
                     // manually decrease cn_count numeric input
                     var cn_spinner = $("input[name='cn_count_lib"+ cn.owning_lib() +"']");
-                    cn_spinner.val(parseInt(cn_spinner.val()) - 1);
+                    if (cn_spinner.val() > 0) cn_spinner.val(parseInt(cn_spinner.val()) - 1);
+                    cn_spinner.trigger("change");
 
                 }
 
@@ -1007,6 +1008,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
         // manually increase cn_count numeric input
         var cn_spinner = $("input[name='cn_count_lib"+ newLib.id() +"']");
         cn_spinner.val(parseInt(cn_spinner.val()) + 1);
+        cn_spinner.trigger("change");
 
         if (!$scope.defaults.classification) {
             egCore.org.settings(
-- 
2.11.0