Skip to content

Commit

Permalink
custom (global) qubely colors missing in image blurb overlay issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
anik committed Nov 14, 2019
1 parent 3a8b873 commit d786d5d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions assets/reactjs/src/components/fields/Gradient.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import Range from "./Range"

const defaultState = { color1: '#16d03e', color2: '#1f91f3', type: 'linear', direction: '90', start: 5, stop: 80, radial: 'center', clip: false };

const colors = [ qubely_admin.palette[0], qubely_admin.palette[1], qubely_admin.palette[2], qubely_admin.palette[3], qubely_admin.palette[4], qubely_admin.palette[5] ];


class Gradient extends Component {

Expand All @@ -19,6 +17,18 @@ class Gradient extends Component {
}
}

defColors() {
let val = [];
const colors = window.globalData.settings;
val.push(colors.colorPreset1 || qubely_admin.palette[0])
val.push(colors.colorPreset2 || qubely_admin.palette[1])
val.push(colors.colorPreset3 || qubely_admin.palette[2])
val.push(colors.colorPreset4 || qubely_admin.palette[3])
val.push(colors.colorPreset5 || qubely_admin.palette[4])
val.push(colors.colorPreset6 || qubely_admin.palette[5])
return val;
}

componentWillMount() {
this.props.onChange(Object.assign({}, defaultState, (this.props.clip ? { clip: this.props.clip } : {}), this.props.value))
}
Expand All @@ -37,7 +47,7 @@ class Gradient extends Component {
}
}} />
<div className="qubely-rgba-palette" style={{ padding: '0px 0px 15px 15px' }}>
{colors.map(
{this.defColors().map(
color => <button style={{ color: color }} onClick={() => this.setSettings(color, colorType)} />
)}
</div>
Expand Down

0 comments on commit d786d5d

Please sign in to comment.