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

View File

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