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>
'<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>'+