Skip to content

Commit

Permalink
The read-only indicator was not removing after the reset of configura…
Browse files Browse the repository at this point in the history
…tion, blocking the `click` and `score` functions.
  • Loading branch information
wbotelhos committed Feb 12, 2013
1 parent af27edb commit 30bcff3
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 34 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -5,7 +5,7 @@ jQuery Raty is a plugin that generates a customizable star rating.
## Version

```
@version 2.5.1
@version 2.5.2
@since 2010.06.11
@author Washington Botelho
@documentation wbotelhos.com/raty
Expand Down
6 changes: 2 additions & 4 deletions changelog.md
@@ -1,12 +1,10 @@
# jQuery Raty - A Star Rating Plugin - http://wbotelhos.com/raty

## 2.5.1
## 2.5.2

### Fixes

+ The `half` options was not displaying the half star.
+ The `path` was receiving double slash;
+ The `path` was setting `null` instead empty when we not using it;
The read-only indicator was not removing after the reset of configuration, blocking the `click` and `score` functions.

## 2.5.1

Expand Down
51 changes: 26 additions & 25 deletions index.html
Expand Up @@ -29,7 +29,7 @@ <h1><a href="http://wbotelhos.com/raty" title="jQuery Raty">jQuery Raty</a></h1>

<nav role="navigation">
<ul>
<li><a href="http://github.com/wbotelhos/raty/archive/2.5.1.zip" title="Download" class="download"><i class="icon-download icon-large"></i>v2.5.1</a></li>
<li><a href="http://github.com/wbotelhos/raty/archive/2.5.2.zip" title="Download" class="download"><i class="icon-download icon-large"></i>v2.5.2</a></li>
<li><a href="http://github.com/wbotelhos/raty" title="Github" target="_blank"><i class="icon-github icon-large"></i>Github</a></li>
<li><a href="http://wbotelhos.com/labs" title="yLab" target="_blank"><i class="icon-beaker icon-large"></i>yLab</a></li>
<li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=X8HEP2878NDEG&amp;item_name=jQuery%20Raty" title="Donate" target="_blank"><i class="icon-heart-empty icon-large"></i>Donate</a></li>
Expand Down Expand Up @@ -85,7 +85,7 @@ <h2 id="score-callback">
</h2>

<p>
If you need to start you <a href="#score">score</a> depending of a dynamic value, you can use callback for it.<br/>
If you need to start you <a href="#score">score</a> depending of a dynamic value, you can to use callback for it.<br/>
You can pass any value for it, not necessarily a <code>data-</code> value. You can use a field value for example.<br />
</p>

Expand Down Expand Up @@ -167,7 +167,7 @@ <h2 id="number-callback">
<a href="#number-callback">Number callback</a>
</h2>

<p>You can receive initialize the number of star dynamic using callback to set it.</p>
<p>You can receive the number of stars dynamic using callback to set it.</p>

<div class="demo">
<div id="number-callback-demo" data-number="3"></div>
Expand Down Expand Up @@ -248,7 +248,7 @@ <h2 id="noRatedMsg">
<pre>
<span class="nx">$</span><span class="p">(</span><span class="s1">'#star'</span><span class="p">).</span><span class="nx">raty</span><span class="p">({</span>
<span class="nx">readOnly</span> <span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="nx">noRatedMsg</span><span class="o">:</span> <span class="s2">"I'am readOnly and a haven't rated yet!"</span>
<span class="nx">noRatedMsg</span><span class="o">:</span> <span class="s2">"I'am readOnly and I haven't rated yet!"</span>
<span class="p">});</span>
</pre>
</div>
Expand Down Expand Up @@ -305,24 +305,6 @@ <h3>Disabled</h3>
</pre>
</div>

<h2 id="starHalf">
<a href="#starHalf">Star Half</a>
</h2>

<p>Changes the name of the half star.</p>

<div class="demo">
<div id="starHalf-demo"></div>
</div>

<div class="highlight">
<pre>
<span class="nx">$</span><span class="p">(</span><span class="s1">'#star'</span><span class="p">).</span><span class="nx">raty</span><span class="p">({</span>
<span class="nx">half</span> <span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="nx">starHalf</span><span class="o">:</span> <span class="s1">'half.png'</span>
<span class="p">});</span>
</pre>
</div>
<h2 id="round">
<a href="#round">Round</a>
</h2>
Expand Down Expand Up @@ -364,6 +346,25 @@ <h2 id="half">
<pre>
<span class="nx">$</span><span class="p">(</span><span class="s1">'#star'</span><span class="p">).</span><span class="nx">raty</span><span class="p">({</span> <span class="nx">half</span><span class="o">:</span> <span class="kc">true</span> });</span>
</pre>
</div>

<h2 id="starHalf">
<a href="#starHalf">Star Half</a>
</h2>

<p>Changes the name of the half star.</p>

<div class="demo">
<div id="starHalf-demo"></div>
</div>

<div class="highlight">
<pre>
<span class="nx">$</span><span class="p">(</span><span class="s1">'#star'</span><span class="p">).</span><span class="nx">raty</span><span class="p">({</span>
<span class="nx">half</span> <span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="nx">starHalf</span><span class="o">:</span> <span class="s1">'half.png'</span>
<span class="p">});</span>
</pre>
</div>

<h2 id="click">
Expand Down Expand Up @@ -1331,7 +1332,7 @@ <h2 id="tests">

$('#noRatedMsg-demo').raty({
readOnly : true,
noRatedMsg: "I'am readOnly and a haven't rated yet!"
noRatedMsg: "I'am readOnly and I haven't rated yet!"
});

$('#score-callback-demo').raty({
Expand All @@ -1347,6 +1348,8 @@ <h2 id="tests">
score : 3.26
});

$('#half-demo').raty({ half: true });

$('#starHalf-demo').raty({
path : 'demo/img',
half : true,
Expand All @@ -1356,8 +1359,6 @@ <h2 id="tests">
starHalf: 'cookie-half.png'
});

$('#half-demo').raty({ half: true });

$('#round-demo').raty({
round: { down: .26, full: .6, up: .76 },
score: 3.26
Expand Down
4 changes: 2 additions & 2 deletions lib/jquery.raty.js
Expand Up @@ -6,7 +6,7 @@
*
* Licensed under The MIT License
*
* @version 2.5.1
* @version 2.5.2
* @since 2010.06.11
* @author Washington Botelho
* @documentation wbotelhos.com/raty
Expand Down Expand Up @@ -369,7 +369,7 @@
raw = that.data('raw');

if (raw) {
that.off('.raty').empty().css({ cursor: raw.style.cursor, width: raw.style.width });
that.off('.raty').empty().css({ cursor: raw.style.cursor, width: raw.style.width }).removeData('readonly');
} else {
that.data('raw', that.clone()[0]);
}
Expand Down

0 comments on commit 30bcff3

Please sign in to comment.