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

Commit d5a757d

Browse files
zachlysobeywesleycho
authored andcommitted
fix(rating): change to read-only
Closes #5371 Closes #5435 BREAKING CHANGE: Attribute supported has been changed to `read-only` from `readonly`
1 parent 01e1998 commit d5a757d

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/rating/docs/demo.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div ng-controller="RatingDemoCtrl">
22
<h4>Default</h4>
3-
<uib-rating ng-model="rate" max="max" readonly="isReadonly" on-hover="hoveringOver(value)" on-leave="overStar = null" titles="['one','two','three']" aria-labelledby="default-rating"></uib-rating>
3+
<uib-rating ng-model="rate" max="max" read-only="isReadonly" on-hover="hoveringOver(value)" on-leave="overStar = null" titles="['one','two','three']" aria-labelledby="default-rating"></uib-rating>
44
<span class="label" ng-class="{'label-warning': percent<30, 'label-info': percent>=30 && percent<70, 'label-success': percent>=70}" ng-show="overStar && !isReadonly">{{percent}}%</span>
55

66
<pre style="margin:15px 0;">Rate: <b>{{rate}}</b> - Readonly is: <i>{{isReadonly}}</i> - Hovering over: <b>{{overStar || "none"}}</b></pre>

src/rating/docs/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Rating directive that will take care of visualising a star rating bar.
2626
_(Default: `null`)_ -
2727
An array of objects defining properties for all icons. In default template, `stateOn` & `stateOff` property is used to specify the icon's class.
2828

29-
* `readonly`
29+
* `read-only`
3030
<small class="badge">$</small>
3131
<i class="icon-eye-open"></i>
3232
_(Default: `false`)_ -

src/rating/rating.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ angular.module('ui.bootstrap.rating', [])
8585
return {
8686
require: ['uibRating', 'ngModel'],
8787
scope: {
88-
readonly: '=?',
88+
readonly: '=?readOnly',
8989
onHover: '&',
9090
onLeave: '&'
9191
},

src/rating/test/rating.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ describe('rating directive', function() {
125125
expect(element.attr('aria-valuemax')).toBe('15');
126126
});
127127

128-
it('handles readonly attribute', function() {
128+
it('handles read-only attribute', function() {
129129
$rootScope.isReadonly = true;
130-
element = $compile('<uib-rating ng-model="rate" readonly="isReadonly"></uib-rating>')($rootScope);
130+
element = $compile('<uib-rating ng-model="rate" read-only="isReadonly"></uib-rating>')($rootScope);
131131
$rootScope.$digest();
132132

133133
expect(getState()).toEqual([true, true, true, false, false]);

0 commit comments

Comments
 (0)