Skip to content

Commit 589595b

Browse files
committed
feat(styling) Add has-error class to search when no result (for BS3)
1 parent 6a7a87e commit 589595b

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

dist/forms-angular.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ formsAngular.controller('SearchCtrl', ['$scope', '$http', '$location', 'routingS
931931
$scope.errorClass = '';
932932
$scope.setFocus(0);
933933
}
934-
$scope.errorClass = $scope.results.length === 0 ? 'error' : '';
934+
$scope.errorClass = $scope.results.length === 0 ? 'error has-error' : '';
935935
} else {
936936
clearSearchResults();
937937
}

dist/forms-angular.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/directives/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ formsAngular.controller('SearchCtrl', ['$scope', '$http', '$location', 'routingS
7575
$scope.errorClass = '';
7676
$scope.setFocus(0);
7777
}
78-
$scope.errorClass = $scope.results.length === 0 ? 'error' : '';
78+
$scope.errorClass = $scope.results.length === 0 ? 'error has-error' : '';
7979
} else {
8080
clearSearchResults();
8181
}

test/unit/searchSpec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe('search', function () {
6969
var results = elm.find('span');
7070
expect(results.length).toBe(0);
7171
var div = angular.element(elm.find('div')[0]);
72-
expect(div.attr('class')).toBe('control-group error');
72+
expect(div.attr('class')).toBe('control-group error has-error');
7373
scope.searchTarget = '';
7474
scope.$digest();
7575
expect(div.attr('class')).toBe('control-group');
@@ -179,4 +179,4 @@ describe('search', function () {
179179
});
180180

181181

182-
});
182+
});

0 commit comments

Comments
 (0)