[jQuery] [BUG] toggleClass - Incorrect RegExp in latest.js
<pre>Here's out of latest.js, shouldn't the toggleClass RegExp match the removeClass? (It's missing two characters "^|")
-js
removeClass: function(c) {
return this.each(function(){
this.className = c == null ? '' :
this.className.replace(
new RegExp('(^|\\s*\\b[^-])'+c+'($|\\b(?=[^-]))', 'g'), '');
});
},
// TODO: Optomize
toggleClass: function(c) {
return
this.each(function(){
if ($.hasWord(this,c))
this.className =
this.className.replace(
new RegExp('(\\s*\\b[^-])'+c+'($|\\b(?=[^-]))', 'g'), '');</pre>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/