Skip to content

Commit

Permalink
Fix #11: Refresh rating corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed May 16, 2014
1 parent 779778c commit 6eaec3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion js/star-rating.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
// Rating public class definition
var Rating = function (element, options) {
this.$elementOrig = $(element);
this.refreshRating = false;
if (isSliderSupported) {
this.init(options);
}
Expand Down Expand Up @@ -148,9 +149,10 @@
*/
init: function (options) {
this.options = options;
if (!this.$elementOrig.is(":visible")) {
if (!this.$elementOrig.is(":visible") && !this.refreshRating) {
return;
}
this.refreshRating = false;
if (typeof this.$element == 'undefined') {
this.initSlider(options);
}
Expand Down Expand Up @@ -321,6 +323,7 @@
refresh: function (options) {
var self = this;
if (arguments.length) {
this.refreshRating = true;
var cap = '';
self.init($.extend(self.options, options));
if (self.showClear) {
Expand Down
2 changes: 1 addition & 1 deletion js/star-rating.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6eaec3e

Please sign in to comment.