Fix Bug 50903
This commit is contained in:
parent
dc50581e7c
commit
dcca2e189e
|
@ -45,7 +45,7 @@ const StandartColors = ({ options, standartColors, onColorClick, curColor }) =>
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
const CustomColors = ({ options, customColors, onColorClick, curColor }) => {
|
const CustomColors = ({ options, customColors, isTypeColors, onColorClick, curColor }) => {
|
||||||
const colors = customColors.length > 0 ? customColors : [];
|
const colors = customColors.length > 0 ? customColors : [];
|
||||||
const emptyItems = [];
|
const emptyItems = [];
|
||||||
if (colors.length < options.customcolors) {
|
if (colors.length < options.customcolors) {
|
||||||
|
@ -64,7 +64,7 @@ const CustomColors = ({ options, customColors, onColorClick, curColor }) => {
|
||||||
{colors && colors.length > 0 && colors.map((color, index) => {
|
{colors && colors.length > 0 && colors.map((color, index) => {
|
||||||
return(
|
return(
|
||||||
<a key={`dc-${index}`}
|
<a key={`dc-${index}`}
|
||||||
className={curColor && curColor === color && index === indexCurColor ? 'active' : ''}
|
className={curColor && curColor === color && index === indexCurColor && !isTypeColors ? 'active' : ''}
|
||||||
style={{background: `#${color}`}}
|
style={{background: `#${color}`}}
|
||||||
onClick={() => {onColorClick(color)}}
|
onClick={() => {onColorClick(color)}}
|
||||||
></a>
|
></a>
|
||||||
|
@ -100,6 +100,7 @@ const ThemeColorPalette = props => {
|
||||||
themeColors[row].push(effect);
|
themeColors[row].push(effect);
|
||||||
});
|
});
|
||||||
const standartColors = Common.Utils.ThemeColor.getStandartColors();
|
const standartColors = Common.Utils.ThemeColor.getStandartColors();
|
||||||
|
let isTypeColors = standartColors.some( value => value === curColor );
|
||||||
// custom color
|
// custom color
|
||||||
let customColors = props.customColors;
|
let customColors = props.customColors;
|
||||||
if (customColors.length < 1) {
|
if (customColors.length < 1) {
|
||||||
|
@ -120,7 +121,7 @@ const ThemeColorPalette = props => {
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem className='dynamic-colors'>
|
<ListItem className='dynamic-colors'>
|
||||||
<div>{ _t.textCustomColors }</div>
|
<div>{ _t.textCustomColors }</div>
|
||||||
<CustomColors options={options} customColors={customColors} onColorClick={props.changeColor} curColor={curColor}/>
|
<CustomColors options={options} isTypeColors={isTypeColors} customColors={customColors} onColorClick={props.changeColor} curColor={curColor}/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
</List>
|
</List>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue