<input type="text" ng-blur="post_code_changed(patron.[% path %])"
class="form-control" ng-model="[% model %]"/>
[% ELSIF field == 'barcode' %]
- <input type="text" ng-blur="barcode_changed(patron.card.barcode)"
+ <input type="text"
+ focus-me="focus_bc"
+ ng-disabled="disable_bc"
+ ng-blur="barcode_changed(patron.card.barcode)"
+ class="form-control" ng-model="[% model %]"/>
+ [% ELSIF field == 'usrname' %]
+ <input type="text"
+ focus-me="focus_usrname"
+ ng-blur="usrname_changed(patron.usrname)"
class="form-control" ng-model="[% model %]"/>
[% ELSE %]
<input type="[% input_type %]"
$scope.patron_id =
patronRegSvc.patron_id = $routeParams.edit_id || $routeParams.id;
+ // for existing patrons, disable barcode input by default
+ $scope.disable_bc = $scope.focus_usrname = Boolean($scope.patron_id);
+ $scope.focus_bc = !Boolean($scope.patron_id);
+
if (!$scope.edit_passthru) {
// in edit more, scope.edit_passthru is delivered to us by
// the enclosing controller. In register mode, there is
$scope.replace_card = function() {
$scope.patron.card.active = false;
$scope.patron.card.ischanged = true;
+ $scope.disable_bc = false;
var new_card = egCore.idl.toHash(new egCore.idl.ac());
new_card.id = patronRegSvc.virt_id--;