Prevent the entity search typeahead "no users found" message from being displayed when the entity is set from code
This commit is contained in:
parent
93fd48d6b0
commit
2a72e91bdb
1 changed files with 8 additions and 4 deletions
|
@ -2728,7 +2728,7 @@ quayApp.directive('entitySearch', function () {
|
||||||
entity['is_org_member'] = true;
|
entity['is_org_member'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.setEntityInternal(entity);
|
$scope.setEntityInternal(entity, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.clearEntityInternal = function() {
|
$scope.clearEntityInternal = function() {
|
||||||
|
@ -2738,8 +2738,12 @@ quayApp.directive('entitySearch', function () {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.setEntityInternal = function(entity) {
|
$scope.setEntityInternal = function(entity, updateTypeahead) {
|
||||||
|
if (updateTypeahead) {
|
||||||
$(input).typeahead('val', $scope.isPersistent ? entity.name : '');
|
$(input).typeahead('val', $scope.isPersistent ? entity.name : '');
|
||||||
|
} else {
|
||||||
|
$(input).val($scope.isPersistent ? entity.name : '');
|
||||||
|
}
|
||||||
|
|
||||||
if ($scope.isPersistent) {
|
if ($scope.isPersistent) {
|
||||||
$scope.currentEntity = entity;
|
$scope.currentEntity = entity;
|
||||||
|
@ -2854,7 +2858,7 @@ quayApp.directive('entitySearch', function () {
|
||||||
|
|
||||||
$(input).on('typeahead:selected', function(e, datum) {
|
$(input).on('typeahead:selected', function(e, datum) {
|
||||||
$scope.$apply(function() {
|
$scope.$apply(function() {
|
||||||
$scope.setEntityInternal(datum.entity);
|
$scope.setEntityInternal(datum.entity, true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Reference in a new issue