1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Prevent the click event from bubbling up and keeping the dropdown visible on searches.

This commit is contained in:
Michael Abashian 2016-06-15 16:38:01 -04:00
parent 3a68a9219a
commit 4159100778
2 changed files with 4 additions and 3 deletions

View File

@ -62,7 +62,7 @@ export default ['$scope', 'Refresh', 'tagSearchService',
};
// triggers a refilter of the list with the newTag
$scope.addTag = function(type) {
$scope.addTag = function($event, type) {
var newTag = tagSearchService
.getTag($scope.currentSearchType,
$scope.newSearchTag,
@ -81,6 +81,7 @@ export default ['$scope', 'Refresh', 'tagSearchService',
tags.push(newTag);
$scope.updateSearch(tags);
}
$event.stopPropagation();
};
// triggers a refilter of the list without the oldTag

View File

@ -29,7 +29,7 @@
placeholder="Search">
<div class="TagSearch-searchButton"
ng-disabled="!newSearchTag"
ng-click="addTag()"
ng-click="addTag($event)"
ng-show="currentSearchType.type === 'text'">
<i class="fa fa-search"></i>
</div>
@ -50,7 +50,7 @@
currentSearchType.type === 'select'">
<div class="TagSearch-dropdownItem"
ng-repeat="type in currentSearchType.typeOptions track by $index"
ng-click="addTag(type)">
ng-click="addTag($event, type)">
{{ type.label }}
</div>
</div>