Skip to content

Commit

Permalink
Fix #150 - Fix colour editor for use in browsers that don't use -webk…
Browse files Browse the repository at this point in the history
…it- prefix
  • Loading branch information
AJDBenner committed Apr 24, 2015
1 parent a7def69 commit f77d6fa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/extensions/default/InlineColorEditor/ColorEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,13 @@ define(function (require, exports, module) {

// Update gradients in color square & opacity slider
this.$selectionBase.css("background-color", colorObject.toHexString());
this.$opacityGradient.css("background-image", "-webkit-gradient(linear, 0% 0%, 0% 100%, from(" + hueColor + "), to(transparent))");

this.$opacityGradient.css("background-image", "-moz-linear-gradient(top, " + hueColor + " 0%, rgba(0,0,0,0) 100%)");
this.$opacityGradient.css("background-image", "-webkit-gradient(linear, top, bottom, color-stop(0%, " + hueColor + "), color-stop(100%,rgba(0,0,0,0)))");
this.$opacityGradient.css("background-image", "-webkit-linear-gradient(top, " + hueColor + " 0%, rgba(0,0,0,0) 100%)");
this.$opacityGradient.css("background-image", "-o-linear-gradient(top, " + hueColor + " 0%, rgba(0,0,0,0) 100%)");
this.$opacityGradient.css("background-image", "-ms-linear-gradient(top, " + hueColor + " 0%, rgba(0,0,0,0) 100%)");
this.$opacityGradient.css("background-image", "linear-gradient(to bottom, " + hueColor + " 0%, rgba(0,0,0,0) 100%)");

// Update slider thumb positions
this.$hueSelector.css("bottom", (this._hsv.h / 360 * 100) + "%");
this.$opacitySelector.css("bottom", (this._hsv.a * 100) + "%");
Expand Down
12 changes: 12 additions & 0 deletions src/extensions/default/InlineColorEditor/css/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,17 @@
}
.color-editor section .color-selection-field .saturation-gradient {
background-image: -webkit-gradient(linear, 0% 50%, 100% 50%, from(#fff), to(rgba(255,255,255,0)));
background-image: -moz-linear-gradient(left, #FFFFFF 0%, rgba(255,255,255,0) 100%);
background-image: -o-linear-gradient(left, #FFFFFF 0%, rgba(255,255,255,0) 100%);
background-image: -ms-linear-gradient(left, #FFFFFF 0%, rgba(255,255,255,0) 100%);
background-image: linear-gradient(left, #FFFFFF 0%, rgba(255,255,255,0) 100%);
}
.color-editor section .color-selection-field .luminosity-gradient {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(#000));
background-image: -moz-linear-gradient(bottom, #000000 0%, rgba(255,255,255,0) 100%);
background-image: -o-linear-gradient(bottom, #000000 0%, rgba(255,255,255,0) 100%);
background-image: -ms-linear-gradient(bottom, #000000 0%, rgba(255,255,255,0) 100%);
background-image: linear-gradient(bottom, #000000 0%, rgba(255,255,255,0) 100%);
}
.color-editor section .color-selection-field .selector-base {
width: 12px;
Expand Down Expand Up @@ -203,6 +211,10 @@
}
.color-editor section .hue-slider {
background-image: -webkit-linear-gradient(top, #f00, #f0f, #00f, #0ff, #0f0, #ff0, #f00);
background-image: -moz-linear-gradient(top, #f00, #f0f, #00f, #0ff, #0f0, #ff0, #f00);
background-image: -o-linear-gradient(top, #f00, #f0f, #00f, #0ff, #0f0, #ff0, #f00);
background-image: -ms-linear-gradient(top, #f00, #f0f, #00f, #0ff, #0f0, #ff0, #f00);
background-image: linear-gradient(top, #f00, #f0f, #00f, #0ff, #0f0, #ff0, #f00);
}
.color-editor section footer {
font-size: 100%;
Expand Down

0 comments on commit f77d6fa

Please sign in to comment.