Skip to content

Commit bdfd61c

Browse files
Arjan KempesArjan Kempes
authored andcommitted
Fixed #10 stars flicker when clicked on
1 parent 99df9da commit bdfd61c

7 files changed

Lines changed: 11 additions & 18 deletions

File tree

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-rateit",
3-
"version": "3.0.2",
3+
"version": "3.0.3",
44
"homepage": "https://github.com/akempes/angular-rateit",
55
"authors": [
66
"Arjan Kempes <a_kempes@msn.com>"

dist/ng-rateit.css

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

dist/ng-rateit.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ module
6363
.controller('ngRateItController', ["$scope", "$timeout", function ( $scope, $timeout ) {
6464
'use strict';
6565

66-
$scope.hide = false;
66+
$scope.isTouch = !! window.hasOwnProperty("ontouchstart") || window.navigator.msMaxTouchPoints > 0;
6767
$scope.orgValue = angular.copy($scope.ngModel);
6868

6969
$scope.min = $scope.min || 0;
@@ -113,17 +113,13 @@ module
113113

114114
$scope.setValue = function (index) {
115115
if (!$scope.readOnly()) {
116-
$scope.hide = true; // Hide element due to presisting IOS :hover
117116
var tmpValue = angular.copy($scope.min + getValue(index));
118117
$scope.beforeRated(tmpValue).then(function () {
119118
$scope.ngModel = tmpValue;
120119
$timeout(function () {
121120
$scope.rated();
122121
});
123122
});
124-
$timeout(function () {
125-
$scope.hide = false;
126-
}, 5); // Show rating s.a.p.
127123
}
128124
};
129125

@@ -146,7 +142,7 @@ module
146142
'ng-style="{\'width\': canelWidth+\'px\', \'height\':cancelHeight+\'px\'}"' +
147143
'></a>' +
148144

149-
'<div ng-if="!hide" id="origin" class="ngrateit-rating">' +
145+
'<div ng-if="!hide" id="origin" class="ngrateit-rating" ng-class="{\'ngrateit-hashover\':!isTouch}">' +
150146
'<span ' +
151147
'class="ngrateit-star ngrateit-bg-star"' +
152148
'ng-repeat="i in getStartParts() track by $index" ' +

0 commit comments

Comments
 (0)