Skip to content
Browse files

Fix for extra spaces when a class is removed.

  • Loading branch information...
1 parent b46a015 commit 50346a55ff618dbeeee96945ee01a2de2eb6bdf2 @joshje committed Jan 25, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/responsive-containers.js
View
4 src/responsive-containers.js
@@ -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 50346a5

Please sign in to comment.
Something went wrong with that request. Please try again.