Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

fix(rating): glyphicons #1244

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rating/docs/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ <h4>Default</h4>
<hr />

<h4>Custom icons</h4>
<div ng-init="x = 5"><rating value="x" max="15" state-on="'icon-ok-sign'" state-off="'icon-ok-circle'"></rating> <b>(<i>Rate:</i> {{x}})</b></div>
<div ng-init="x = 5"><rating value="x" max="15" state-on="'glyphicon-ok-sign'" state-off="'glyphicon-ok-circle'"></rating> <b>(<i>Rate:</i> {{x}})</b></div>
<div ng-init="y = 2"><rating value="y" rating-states="ratingStates"></rating> <b>(<i>Rate:</i> {{y}})</b></div>
</div>
10 changes: 5 additions & 5 deletions src/rating/docs/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ var RatingDemoCtrl = function ($scope) {
};

$scope.ratingStates = [
{stateOn: 'icon-ok-sign', stateOff: 'icon-ok-circle'},
{stateOn: 'icon-star', stateOff: 'icon-star-empty'},
{stateOn: 'icon-heart', stateOff: 'icon-ban-circle'},
{stateOn: 'icon-heart'},
{stateOff: 'icon-off'}
{stateOn: 'glyphicon-ok', stateOff: 'glyphicon-ok-circle'},
{stateOn: 'glyphicon-star', stateOff: 'glyphicon-star-empty'},
{stateOn: 'glyphicon-heart', stateOff: 'glyphicon-ban-circle'},
{stateOn: 'glyphicon-heart'},
{stateOff: 'glyphicon-off'}
];
};
2 changes: 1 addition & 1 deletion src/rating/docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Rating directive that will take care of visualising a star rating bar.

#### `<rating>` ####

* `value` <i class="icon-eye-open"></i>
* `value` <i class="glyphicon glyphicon-eye-open"></i>
:
The current rate.

Expand Down
6 changes: 3 additions & 3 deletions src/rating/test/rating.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('rating directive', function () {
var stars = getStars();
var state = [];
for (var i = 0, n = stars.length; i < n; i++) {
state.push( (stars.eq(i).hasClass(classOn || 'icon-star') && ! stars.eq(i).hasClass(classOff || 'icon-star-empty')) );
state.push( (stars.eq(i).hasClass(classOn || 'glyphicon-star') && ! stars.eq(i).hasClass(classOff || 'glyphicon-star-empty')) );
}
return state;
}
Expand Down Expand Up @@ -126,8 +126,8 @@ describe('rating directive', function () {

describe('custom states', function() {
beforeEach(inject(function() {
$rootScope.classOn = 'icon-ok-sign';
$rootScope.classOff = 'icon-ok-circle';
$rootScope.classOn = 'glyphicon-ok-sign';
$rootScope.classOff = 'glyphicon-ok-circle';
element = $compile('<rating value="rate" state-on="classOn" state-off="classOff"></rating>')($rootScope);
$rootScope.$digest();
}));
Expand Down
2 changes: 1 addition & 1 deletion template/rating/rating.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<span ng-mouseleave="reset()">
<i ng-repeat="r in range" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" ng-class="$index < val && (r.stateOn || 'icon-star') || (r.stateOff || 'icon-star-empty')"></i>
<i ng-repeat="r in range" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" ng-class="$index < val && (r.stateOn || 'glyphicon-star') || (r.stateOff || 'glyphicon-star-empty')" class="glyphicon"></i>
</span>