Skip to content

Commit d9e0f48

Browse files
bekospkozlowski-opensource
authored andcommitted
refactor(rating): increase test coverage
1 parent f56a396 commit d9e0f48

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/rating/rating.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ angular.module('ui.bootstrap.rating', [])
2828
$scope.range = angular.isDefined($attrs.ratingStates) ? this.createRateObjects(angular.copy($scope.$parent.$eval($attrs.ratingStates))): this.createRateObjects(new Array(this.maxRange));
2929

3030
$scope.rate = function(value) {
31-
if ( $scope.readonly || $scope.value === value) {
32-
return;
31+
if ( $scope.value !== value && !$scope.readonly ) {
32+
$scope.value = value;
3333
}
34-
35-
$scope.value = value;
3634
};
3735

3836
$scope.enter = function(value) {

0 commit comments

Comments
 (0)