make single tag search bars have their filter type non-clickable

This commit is contained in:
John Mitchell 2016-06-22 12:09:36 -04:00
parent c6cd966fc8
commit 9b28e80e0c
3 changed files with 9 additions and 2 deletions

View File

@ -34,6 +34,11 @@
position: relative;
}
.TagSearch-typeDropdown.is-single {
cursor: default;
padding-right: 12px;
}
.TagSearch-typeDropdown.is-open {
border-bottom-left-radius: 0;
}

View File

@ -15,7 +15,9 @@ export default ['$scope', 'Refresh', 'tagSearchService',
// shows/hide the search type dropdown
$scope.toggleTypeDropdown = function() {
$scope.showTypeDropdown = !$scope.showTypeDropdown;
if ($scope.searchTypes.length > 1) {
$scope.showTypeDropdown = !$scope.showTypeDropdown;
}
};
// sets the search type dropdown and hides it

View File

@ -3,7 +3,7 @@
<div class="TagSearch-bar">
<div class="TagSearch-typeDropdown"
ng-click="toggleTypeDropdown()"
ng-class="{'is-open': showTypeDropdown}"
ng-class="{'is-open': showTypeDropdown, 'is-single': searchTypes.length === 1}"
ng-cloak>
<span class="TagSearch-typeDropdownName" ng-cloak>
{{ currentSearchType.label }}