Skip to content

Commit

Permalink
hotfix: add display param to iro.ColorPicker
Browse files Browse the repository at this point in the history
  • Loading branch information
jaames committed Jan 26, 2018
1 parent 7a3145a commit c080c12
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 21 deletions.
14 changes: 9 additions & 5 deletions dist/iro.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/iro.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/iro.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iro.js",
"version": "3.2.0",
"version": "3.2.1",
"description": "A sleek and lightweight JS color picker - with zero dependencies",
"main": "dist/iro.js",
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/colorPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ colorPicker.prototype = {

// Create UI elements
this.el = el;
this.svg = new svg(el, width, height);
this.svg = new svg(el, width, height, opts.display);
this.ui = [
new wheel(this.svg, {
cX: leftMargin + bodyWidth / 2,
Expand Down
8 changes: 6 additions & 2 deletions src/ui/svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,12 @@ svgGradient.prototype.getUrl = function(base) {
* @param {Number} width - svg width
* @param {Number} height - svg height
*/
const svgRoot = function(parent, width, height) {
svgElement.call(this, this, parent, "svg", {width, height, style: "display:block"});
const svgRoot = function(parent, width, height, display) {
svgElement.call(this, this, parent, "svg", {
width,
height,
style: "display:" + (display || "block")
});
this._defs = this.insert("defs");
this._gradients = [];
};
Expand Down
1 change: 1 addition & 0 deletions www/src/docs/colorPicker_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ github_url: https://github.com/jaames/iro.js/blob/master/www/src/colorPicker_api
* `{Number} markerRadius`
* `{Number} borderWidth`
* `{String} borderColor`
* `{String} display`
* `{Boolean} anticlockwise`
* `{Object} css`

Expand Down
3 changes: 2 additions & 1 deletion www/src/docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ var demoColorPicker = new iro.ColorPicker("#color-picker-container", {
| `sliderMargin` | Distance between the hue/saturation wheel and the slider controls. | `24` |
| `sliderHeight` | Slider control height (by default this will be calculated automatically). | `undefined` |
| `borderWidth` | Width of the border around the controls. Defaults to 0 (no border). | `0` |
| `borderColor` | Color of the border, any valid CSS color is supported. | `#fff` |
| `borderColor` | Color of the border, any valid CSS color is supported. | `"#fff"` |
| `display` | SVG element's CSS display property value. | `"block"` |
| `anticlockwise` | If set to `true`, the color wheel will be drawn in the other direction, with blues and purples towards the lower half of the wheel. | `false` |
| `wheelLightness`| If set to `false`, the color wheel will not fade to black as the color's lightness decreases. This is not recommended, for reasons noted in [this issue thread](https://github.com/jaames/iro.js/issues/9#issuecomment-336628451) | `undefined` |
| `css` | The CSS template used for the [Dynamic CSS](#Dynamic-CSS) feature. | `{}` |
Expand Down
14 changes: 9 additions & 5 deletions www/themes/iro/source/js/iro.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion www/themes/iro/source/js/iro.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions www/themes/iro/source/js/iro.min.js

Large diffs are not rendered by default.

0 comments on commit c080c12

Please sign in to comment.