Skip to content

Commit

Permalink
Added a check to avoid issues with AJAX #21
Browse files Browse the repository at this point in the history
  • Loading branch information
javiertoledo committed Aug 12, 2014
1 parent 92788b1 commit a0682a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/bootstrap-rating-input.min.js

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "bootstrap-rating-input",
"version": "0.2.4",
"repository": "https://github.com/javiertoledo/bootstrap-rating-input.git",
"devDependencies": {
"uglify-js": "1.3.5",
"grunt": "0.4.2",
Expand Down
7 changes: 4 additions & 3 deletions src/bootstrap-rating-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
input.val(val).trigger('change');
if (val === input.data('empty-value')) {
input.siblings('.rating-clear').hide();
}
else {
} else {
input.siblings('.rating-clear').show();
}
}
Expand Down Expand Up @@ -66,7 +65,9 @@
'</div>'].join('');

// Replace original inputs HTML with the new one
originalInput.replaceWith($(el).append(newInput));
if (originalInput.parents('.rating-input').length <= 0) {
originalInput.replaceWith($(el).append(newInput));
}

}

Expand Down

0 comments on commit a0682a5

Please sign in to comment.