mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 16:47:45 -02:30
Disable search submit until a search string is present
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
<span class="input-group-btn">
|
||||
<button class="btn at-ButtonHollow--default at-Input-button"
|
||||
ng-click="vm.submitSearch()"
|
||||
ng-disabled="vm.disabled"
|
||||
ng-disabled="vm.disabled || !vm.value || vm.value === ''"
|
||||
type="button">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
|
||||
@@ -76,10 +76,15 @@
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.SmartSearch-searchButton:hover {
|
||||
.SmartSearch-searchButton:not(.SmartSearch-searchButton--disabled):hover {
|
||||
background-color: @default-tertiary-bg;
|
||||
}
|
||||
|
||||
.SmartSearch-searchButton--disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.65;
|
||||
}
|
||||
|
||||
.SmartSearch-flexContainer {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
|
||||
@@ -174,6 +174,7 @@ function SmartSearchController (
|
||||
};
|
||||
|
||||
$scope.addTerms = terms => {
|
||||
if (terms && terms !== "") {
|
||||
const { singleSearchParam } = $scope;
|
||||
const unmodifiedQueryset = _.clone(queryset);
|
||||
|
||||
@@ -211,6 +212,7 @@ function SmartSearchController (
|
||||
$scope.searchTerm = null;
|
||||
|
||||
generateSearchTags();
|
||||
}
|
||||
};
|
||||
// remove tag, merge new queryset, $state.go
|
||||
$scope.removeTerm = index => {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<input class="SmartSearch-input" ng-model="searchTerm" placeholder="{{searchPlaceholder}}"
|
||||
ng-disabled="disableSearch">
|
||||
</form>
|
||||
<div type="submit" class="SmartSearch-searchButton" ng-disabled="!searchTerm" ng-click="addTerms(searchTerm)">
|
||||
<div type="submit" class="SmartSearch-searchButton" ng-class="{'SmartSearch-searchButton--disabled': !searchTerm || searchTerm === ''}" ng-click="addTerms(searchTerm)">
|
||||
<i class="fa fa-search"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user