LP#1929136: delay barcode lookup on change in holdings editor
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Thu, 20 May 2021 21:51:17 +0000 (14:51 -0700)
committerGalen Charlton <gmc@equinoxOLI.org>
Wed, 7 Jul 2021 14:27:32 +0000 (10:27 -0400)
In the Holdings Editor, any change to the barcode field results in an
immediate API call.  Thus, if you type the barcode "123456789", you
would get 9 separate calls: 1, 12, 123, 1234, 12345 ...

This commit adds a 1000ms delay to avoid excessive pcrud calls when
typing a barcode.

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index 57848b4..ac6a7b8 100644 (file)
@@ -524,7 +524,7 @@ function(egCore , $q) {
                 '<div class="col-xs-5" ng-class="{'+"'has-error'"+':barcode_has_error}">'+
                     '<input id="{{callNumber.id()}}_{{copy.id()}}"'+
                     ' eg-enter="nextBarcode(copy.id())" class="form-control"'+
-                    ' type="text" ng-model="barcode" ng-change="updateBarcode()"'+
+                    ' type="text" ng-model="barcode" ng-model-options="{ debounce: 1000 }" ng-change="updateBarcode()"'+
                     ' ng-focus="selectOnFocus($event)" autofocus/>'+
                     '<div class="label label-danger" ng-if="duplicate_barcode">{{duplicate_barcode_string}}</div>'+
                     '<div class="label label-danger" ng-if="empty_barcode">{{empty_barcode_string}}</div>'+