Permalink
Browse files

Fix bug with IE

  • Loading branch information...
ndp committed Oct 21, 2010
1 parent 36d81ff commit 858b813f8e4688f61d8481b3215f4f7d85cd5f43
Showing with 13 additions and 3 deletions.
  1. +7 −2 csster.js
  2. +6 −1 src/core.js
View
@@ -4,7 +4,7 @@
//
// See http://github.com/ndp/csster
//
-// Generated Thu Oct 21 10:19:45 PDT 2010
+// Generated Thu Oct 21 10:41:04 PDT 2010
//
//
if (!Csster) {
@@ -438,6 +438,9 @@ Csster.preprocessProperties = function(properties) {
}
}
+Csster.trimString = function(s) {
+ return s.replace(/^\s*/, "").replace(/\s*$/, "");
+}
Csster.expandAndFlatten = function(selector, properties) {
@@ -467,7 +470,9 @@ Csster.expandAndFlatten = function(selector, properties) {
var subs = p.split(',');
for (var s = 0; s < subs.length; s++) {
- subs[s] = selector + ((subs[s].substr(0, 1) == '&') ? subs[s].substr(1) : ' ' + subs[s].trim());
+ var str = subs[s];
+ var ampRule = (str.substr(0, 1) == '&');
+ subs[s] = selector + (ampRule ? str.substr(1) : ' ' + Csster.trimString(str));
}
rules.push(Csster.expandAndFlatten(subs.join(','), properties[p]));
}
View
@@ -363,6 +363,9 @@ Csster.preprocessProperties = function(properties) {
}
}
+Csster.trimString = function(s) {
+ return s.replace(/^\s*/, "").replace(/\s*$/, "");
+}
Csster.expandAndFlatten = function(selector, properties) {
@@ -392,7 +395,9 @@ Csster.expandAndFlatten = function(selector, properties) {
var subs = p.split(',');
for (var s = 0; s < subs.length; s++) {
- subs[s] = selector + ((subs[s].substr(0, 1) == '&') ? subs[s].substr(1) : ' ' + subs[s].trim());
+ var str = subs[s];
+ var ampRule = (str.substr(0, 1) == '&');
+ subs[s] = selector + (ampRule ? str.substr(1) : ' ' + Csster.trimString(str));
}
rules.push(Csster.expandAndFlatten(subs.join(','), properties[p]));
}

0 comments on commit 858b813

Please sign in to comment.