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

Commit

Permalink
fix(rating): change to read-only
Browse files Browse the repository at this point in the history
Closes #5371
Closes #5435

BREAKING CHANGE: Attribute supported has been changed to `read-only`
from `readonly`
  • Loading branch information
zachlysobey authored and wesleycho committed Feb 7, 2016
1 parent 01e1998 commit d5a757d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/rating/docs/demo.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div ng-controller="RatingDemoCtrl">
<h4>Default</h4>
<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>
<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>
<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>

<pre style="margin:15px 0;">Rate: <b>{{rate}}</b> - Readonly is: <i>{{isReadonly}}</i> - Hovering over: <b>{{overStar || "none"}}</b></pre>
Expand Down
2 changes: 1 addition & 1 deletion src/rating/docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Rating directive that will take care of visualising a star rating bar.
_(Default: `null`)_ -
An array of objects defining properties for all icons. In default template, `stateOn` & `stateOff` property is used to specify the icon's class.

* `readonly`
* `read-only`
<small class="badge">$</small>
<i class="icon-eye-open"></i>
_(Default: `false`)_ -
Expand Down
2 changes: 1 addition & 1 deletion src/rating/rating.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ angular.module('ui.bootstrap.rating', [])
return {
require: ['uibRating', 'ngModel'],
scope: {
readonly: '=?',
readonly: '=?readOnly',
onHover: '&',
onLeave: '&'
},
Expand Down
4 changes: 2 additions & 2 deletions src/rating/test/rating.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ describe('rating directive', function() {
expect(element.attr('aria-valuemax')).toBe('15');
});

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

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

0 comments on commit d5a757d

Please sign in to comment.