Permalink
Browse files

Improved remove class method.

  • Loading branch information...
1 parent 73fec98 commit eed5265999f737b0203a41d88e75bb87e429571e @ahume committed Jan 25, 2012
Showing with 8 additions and 6 deletions.
  1. +5 −5 responsive-containers.min.js
  2. +3 −1 src/responsive-containers.js

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -99,7 +99,9 @@ THE SOFTWARE.
el.className += " " + rule[4];
}
} else {
- el.className = (" " + el.className + " ").replace(" " + rule[4] + " ", " ");
+ var class_name = el.className.replace(new RegExp('(^| )'+rule[4]+'( |$)'), '$1');
+ class_name = class_name.replace(/ $/, '');
+ el.className = class_name;
}
}
}

0 comments on commit eed5265

Please sign in to comment.