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

Commit

Permalink
FIX: Repaint now removes already created custom form elements (the vi…
Browse files Browse the repository at this point in the history
…sual elements, not the actual form elements) to handle any changes in the DOM.
  • Loading branch information
karbassi committed Sep 15, 2010
1 parent a66483d commit 65088ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/custom-form-elements.js
Expand Up @@ -72,13 +72,15 @@ Example:
},

repaint: function(){
var self = this;
var self = this,
prev;

$('input.' + self.options.styled + '[type=checkbox], input.' + self.options.styled + '[type=radio], select.' + self.options.styled).each(function(){

// stop already created ones.
if ($(this).prev().is('[class*=' + self.options.uniqueClassName + ']')) {
return;
var prev = $(this).prev();
if (prev.is('[class*=' + self.options.uniqueClassName + ']')) {
prev.remove();
}

var selected = $('option:selected', this).text(),
Expand Down
8 changes: 4 additions & 4 deletions src/custom-form-elements.min.js

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

0 comments on commit 65088ab

Please sign in to comment.