Only highlight style changes for the currently selected state (normal / hover)
This commit is contained in:
parent
7b82896cf1
commit
2cd2fba342
|
@ -10,7 +10,7 @@
|
||||||
export let onStyleChanged = () => {}
|
export let onStyleChanged = () => {}
|
||||||
export let open = false
|
export let open = false
|
||||||
|
|
||||||
const hasPropChanged = prop => {
|
const hasPropChanged = (style, prop) => {
|
||||||
// TODO: replace color picker with one that works better.
|
// TODO: replace color picker with one that works better.
|
||||||
// Currently it cannot support null values, so this is a hack which
|
// Currently it cannot support null values, so this is a hack which
|
||||||
// prevents the color fields from always being marked as changed
|
// prevents the color fields from always being marked as changed
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$: style = componentInstance["_styles"][styleCategory] || {}
|
$: style = componentInstance["_styles"][styleCategory] || {}
|
||||||
$: changed = properties.some(prop => hasPropChanged(prop))
|
$: changed = properties.some(prop => hasPropChanged(style, prop))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<DetailSummary name={`${name}${changed ? ' *' : ''}`} on:open show={open} thin>
|
<DetailSummary name={`${name}${changed ? ' *' : ''}`} on:open show={open} thin>
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
<div>
|
<div>
|
||||||
{#each properties as prop}
|
{#each properties as prop}
|
||||||
<PropertyControl
|
<PropertyControl
|
||||||
label={`${prop.label}${hasPropChanged(prop) ? ' *' : ''}`}
|
label={`${prop.label}${hasPropChanged(style, prop) ? ' *' : ''}`}
|
||||||
control={prop.control}
|
control={prop.control}
|
||||||
key={prop.key}
|
key={prop.key}
|
||||||
value={style[prop.key]}
|
value={style[prop.key]}
|
||||||
|
|
Loading…
Reference in New Issue