From fac3adb3e2e41ea1dde8407b8286aaeeee3a03f6 Mon Sep 17 00:00:00 2001 From: redroger Date: Tue, 9 Jul 2013 15:55:59 -0400 Subject: [PATCH 1/6] Update style.js --- lib/style.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/style.js b/lib/style.js index 34f3600..4fb43ac 100644 --- a/lib/style.js +++ b/lib/style.js @@ -41,7 +41,7 @@ Style = (function() { attr = [" width: " + image.cssw + "px", " height: " + image.cssh + "px", " background-position: " + (-image.cssx) + "px " + (-image.cssy) + "px"]; image.style = this.cssStyle(attr); image.selector = this.resolveImageSelector(image.name, image.path); - styles.push(this.css([this.selector, image.selector].join('.'), attr)); + styles.push(this.css([this.selector, image.selector].join(' .'), attr)); } styles.push("") css = styles.join("\n"); From ff72d2caf4d7efc95ed86c5eeaf72cdfafa6355e Mon Sep 17 00:00:00 2001 From: redroger Date: Tue, 9 Jul 2013 16:02:02 -0400 Subject: [PATCH 2/6] Update style.js --- lib/style.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/style.js b/lib/style.js index 4fb43ac..34f3600 100644 --- a/lib/style.js +++ b/lib/style.js @@ -41,7 +41,7 @@ Style = (function() { attr = [" width: " + image.cssw + "px", " height: " + image.cssh + "px", " background-position: " + (-image.cssx) + "px " + (-image.cssy) + "px"]; image.style = this.cssStyle(attr); image.selector = this.resolveImageSelector(image.name, image.path); - styles.push(this.css([this.selector, image.selector].join(' .'), attr)); + styles.push(this.css([this.selector, image.selector].join('.'), attr)); } styles.push("") css = styles.join("\n"); From 58624b719272536e614f4c8dab9cca6b04c2459f Mon Sep 17 00:00:00 2001 From: redroger Date: Tue, 9 Jul 2013 16:29:17 -0400 Subject: [PATCH 3/6] Update style.js --- lib/style.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/style.js b/lib/style.js index 34f3600..a9b5751 100644 --- a/lib/style.js +++ b/lib/style.js @@ -41,7 +41,7 @@ Style = (function() { attr = [" width: " + image.cssw + "px", " height: " + image.cssh + "px", " background-position: " + (-image.cssx) + "px " + (-image.cssy) + "px"]; image.style = this.cssStyle(attr); image.selector = this.resolveImageSelector(image.name, image.path); - styles.push(this.css([this.selector, image.selector].join('.'), attr)); + styles.push(image.selector, attr)); } styles.push("") css = styles.join("\n"); From 20598546a2c2b3b97d1e33061cffce8d902761ee Mon Sep 17 00:00:00 2001 From: redroger Date: Tue, 9 Jul 2013 17:27:56 -0400 Subject: [PATCH 4/6] Update style.js The css formatting was causing errors within FF, FF background images will not load properly if its shorthand. In addition the con-cat of the sprite and image cannot be on the same line, each image has their own position --- lib/style.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/style.js b/lib/style.js index a9b5751..79bfc0a 100644 --- a/lib/style.js +++ b/lib/style.js @@ -35,13 +35,13 @@ Style = (function() { var attr, image, imagePath, images, pixelRatio, relativeImagePath, styles, _i, _len; imagePath = options.imagePath, relativeImagePath = options.relativeImagePath, images = options.images, pixelRatio = options.pixelRatio; this.pixelRatio = pixelRatio || 1; - styles = [this.css(this.selector, [" background: url( '" + relativeImagePath + "' ) no-repeat"])]; + styles = [this.css(this.selector, [" background-image: url( '" + relativeImagePath + "' )"])]; for (_i = 0, _len = images.length; _i < _len; _i++) { image = images[_i]; attr = [" width: " + image.cssw + "px", " height: " + image.cssh + "px", " background-position: " + (-image.cssx) + "px " + (-image.cssy) + "px"]; image.style = this.cssStyle(attr); image.selector = this.resolveImageSelector(image.name, image.path); - styles.push(image.selector, attr)); + styles.push('.'+image.selector, attr)); } styles.push("") css = styles.join("\n"); @@ -54,7 +54,7 @@ Style = (function() { (-webkit-min-device-pixel-ratio: " + this.pixelRatio + "),\n \ (min-device-pixel-ratio: " + this.pixelRatio + ") {\n \ .sprite {\n \ - background: url( '" + options.relativeImagePath + "' ) no-repeat;\n \ + background-image: url( '" + options.relativeImagePath + "' ) ;\n \ -moz-background-size: " + spriteWidth + "px " + spriteHeight + "px;\n \ -ie-background-size: " + spriteWidth + "px " + spriteHeight + "px;\n \ -o-background-size: " + spriteWidth + "px " + spriteHeight + "px;\n \ From 8174002583e9272ccafebbd26eb4e47d59b235d2 Mon Sep 17 00:00:00 2001 From: redroger Date: Fri, 12 Jul 2013 09:49:20 -0400 Subject: [PATCH 5/6] remove extra parenthesis --- lib/style.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/style.js b/lib/style.js index 79bfc0a..ae193f1 100644 --- a/lib/style.js +++ b/lib/style.js @@ -41,7 +41,7 @@ Style = (function() { attr = [" width: " + image.cssw + "px", " height: " + image.cssh + "px", " background-position: " + (-image.cssx) + "px " + (-image.cssy) + "px"]; image.style = this.cssStyle(attr); image.selector = this.resolveImageSelector(image.name, image.path); - styles.push('.'+image.selector, attr)); + styles.push('.'+image.selector, attr); } styles.push("") css = styles.join("\n"); From 1efd1b2d68afc68ffe12750b401249db0471e052 Mon Sep 17 00:00:00 2001 From: redroger Date: Fri, 12 Jul 2013 09:52:00 -0400 Subject: [PATCH 6/6] update style.js accidentally remove the function for css within line 44 --- lib/style.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/style.js b/lib/style.js index ae193f1..2588096 100644 --- a/lib/style.js +++ b/lib/style.js @@ -41,7 +41,7 @@ Style = (function() { attr = [" width: " + image.cssw + "px", " height: " + image.cssh + "px", " background-position: " + (-image.cssx) + "px " + (-image.cssy) + "px"]; image.style = this.cssStyle(attr); image.selector = this.resolveImageSelector(image.name, image.path); - styles.push('.'+image.selector, attr); + styles.push(this.css('.'+image.selector, attr)); } styles.push("") css = styles.join("\n");