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

fix(rating): hyphenate read-only attribute #5435

Closed
wants to merge 1 commit into from
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
@@ -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