Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bug fix. #130

Closed
wants to merge 2 commits into from

4 participants

@fabrikagency

spanTag text uses .text() instead of .html(). Fixes a bug where 's have & as text.

I was having an issue where an option looked like this:
one & two

After selecting it, uniform would display a & amp ; to the user instead of &.

@checat

There is another line that needs same change in function "keyup.uniform"

Also: since browsers strip all tags inside "option" tag at parse time, those lines can be easily changed to use only text()
spanTag.text(elem.find(":selected").text());
in event handlers and another line
spanTag.text(selected.text());
in init code

Issue link for reference: pixelmatrix/uniform#128

@claviska

This is an issue I noticed right away. Switched html() to text() (as mentioned above) and all is well.

@fidian
Collaborator

This was just merged into master, plus it was fixed on other forks of the project. I'm marking it as closed, but please feel free to reopen, comment, or make a new issue if this was not addressed fully.

@fidian fidian closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 18, 2011
  1. @fabrikagency
Commits on Feb 24, 2011
  1. @fabrikagency
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +4 −4 jquery.uniform.js
View
8 jquery.uniform.js
@@ -170,7 +170,7 @@ Enjoy!
if(selected.length == 0){
selected = elem.find("option:first");
}
- spanTag.html(selected.html());
+ spanTag.html(selected.text());
elem.css('opacity', 0);
elem.wrap(divTag);
@@ -182,7 +182,7 @@ Enjoy!
elem.bind({
"change.uniform": function() {
- spanTag.text(elem.find(":selected").html());
+ spanTag.text(elem.find(":selected").text());
divTag.removeClass(options.activeClass);
},
"focus.uniform": function() {
@@ -209,7 +209,7 @@ Enjoy!
divTag.removeClass(options.activeClass);
},
"keyup.uniform": function(){
- spanTag.text(elem.find(":selected").html());
+ spanTag.text(elem.find(":selected").text());
}
});
@@ -566,7 +566,7 @@ Enjoy!
divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
//reset current selected text
- spanTag.html($e.find(":selected").html());
+ spanTag.html($e.find(":selected").text());
if($e.is(":disabled")){
divTag.addClass(options.disabledClass);
Something went wrong with that request. Please try again.