From e285e4baa9fd39f9acb1b5fc722cd3736ec696e9 Mon Sep 17 00:00:00 2001 From: Remington Steed Date: Wed, 7 Feb 2018 14:41:47 -0500 Subject: [PATCH] LP#1747963 Fix "trim list" feature in web client The use of splice() here caused buggy behavior and seemed to be a typo, so I tried using slice() instead. But that still didn't work correctly. The list stopped adding items after it reached 21 total, so scanning a new barcode didn't add it to the list but only refreshed the list. Instead, this commit sets the length of the array to 20, which shortens the array as described in the MDN documentation for Array.length. Now it behaves like it did in the XUL client. Signed-off-by: Remington Steed Signed-off-by: Cesar Velez Signed-off-by: Bill Erickson --- Open-ILS/web/js/ui/default/staff/circ/checkin/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js index 516e43f172..5076140557 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js @@ -217,7 +217,8 @@ function($scope , $q , $window , $location , $timeout , egCore , checkinSvc , eg } if ($scope.trim_list && checkinSvc.checkins.length > 20) - checkinSvc.checkins = checkinSvc.checkins.splice(0, 20); + //cut array short at 20 items + checkinSvc.checkins.length = 20; }, function() { // Checkin was rejected somewhere along the way. -- 2.11.0