lp1332651 do not strip internal spaces followup collab/phasefx/lp1332651-internal-space-followup
authorJason Etheridge <jason@EquinoxInitiative.org>
Sat, 22 Aug 2020 04:40:55 +0000 (00:40 -0400)
committerJason Etheridge <jason@EquinoxInitiative.org>
Sat, 22 Aug 2020 04:40:55 +0000 (00:40 -0400)
for Item Status

Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>
Open-ILS/web/js/ui/default/staff/cat/item/app.js

index 2237d75..3ee36ca 100644 (file)
@@ -371,11 +371,9 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD
             var barcodes = [];
 
             angular.forEach(newVal.split(/\r?\n/), function(line) {
-                //remove all whitespace and commas
-                line = line.replace(/[\s,]+/g,'');
-
                 //Or remove leading/trailing whitespace
-                //line = line.replace(/(^[\s,]+|[\s,]+$/g,'');
+                line = line.replace(/^[\s,]+/g,'')
+                line = line.replace(/[\s,]+$/g,'');
 
                 if (!line) return;
                 barcodes.push(line);
@@ -420,11 +418,9 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD
         var barcodes = [];
         //split on commas and clean up barcodes
         angular.forEach(args.barcode.split(/,/), function(line) {
-            //remove all whitespace and commas
-            line = line.replace(/[\s,]+/g,'');
-
             //Or remove leading/trailing whitespace
-            //line = line.replace(/(^[\s,]+|[\s,]+$/g,'');
+            line = line.replace(/^[\s,]+/g,'')
+            line = line.replace(/[\s,]+$/g,'');
 
             if (!line) return;
             barcodes.push(line);