Permalink
Browse files

added fallback syntax for gradients and box-shadow

was a bit overdue ;)
  • Loading branch information...
mrflix committed Jan 19, 2012
1 parent a7a9202 commit 4f594a5d62c0a2f781c3d323e4a70a5820f9937b
Showing with 12 additions and 3 deletions.
  1. +12 −3 js/codebox.js
View
@@ -1,6 +1,6 @@
var codeBox = {
options: {
- visible: false,
+ visible: true,
height: 163
},
minHeight: 100,
@@ -102,11 +102,20 @@ var codeBox = {
}
// add gradient
if(currentStyle.background.isActive){
- this.code += "background-image: " + css.drawGradient(currentStyle, "-moz-") + ";<br>";
+ this.code += "background: " + tools.averageGradientColor(currentStyle.background.stops) + ";<br>";
this.code += "background-image: " + css.drawGradient(currentStyle, "-oldwebkit-") + ";<br>";
+ this.code += "background-image: " + css.drawGradient(currentStyle, "-webkit-") + ";<br>";
+ this.code += "background-image: " + css.drawGradient(currentStyle, "-moz-") + ";<br>";
+ this.code += "background-image: " + css.drawGradient(currentStyle, "-o-") + ";<br>";
+ this.code += "background-image: " + css.drawGradient(currentStyle, "-ms-") + ";<br>";
+ this.code += "background-image: " + css.drawGradient(currentStyle, "") + ";<br>";
}
// add dropShadow and innerShadow
- this.code += currentStyle.dropShadow.isActive || currentStyle.innerShadow.isActive ? "box-shadow: " + css.boxShadow(currentStyle) + ";<br>" : "";
+ if(currentStyle.dropShadow.isActive || currentStyle.innerShadow.isActive){
+ this.code += "-webkit-box-shadow: " + css.boxShadow(currentStyle) + ";<br>";
+ this.code += "-moz-box-shadow: " + css.boxShadow(currentStyle) + ";<br>";
+ this.code += "box-shadow: " + css.boxShadow(currentStyle) + ";<br>";
+ }
this.$box.html(this.code);
}
};

0 comments on commit 4f594a5

Please sign in to comment.