Update behaviour for copying bindings
This commit is contained in:
parent
034369119c
commit
97447981dc
|
@ -75,6 +75,9 @@
|
||||||
if (isObject) {
|
if (isObject) {
|
||||||
return Colors.Object
|
return Colors.Object
|
||||||
}
|
}
|
||||||
|
if (value instanceof Date) {
|
||||||
|
return Colors.Date
|
||||||
|
}
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case undefined:
|
case undefined:
|
||||||
return Colors.Undefined
|
return Colors.Undefined
|
||||||
|
@ -91,15 +94,12 @@
|
||||||
case "number":
|
case "number":
|
||||||
return Colors.Number
|
return Colors.Number
|
||||||
}
|
}
|
||||||
if (value instanceof Date) {
|
|
||||||
return Colors.Date
|
|
||||||
}
|
|
||||||
return Colors.Other
|
return Colors.Other
|
||||||
}
|
}
|
||||||
|
|
||||||
const copyValue = () => {
|
const copyBinding = () => {
|
||||||
Helpers.copyToClipboard(JSON.stringify(value))
|
Helpers.copyToClipboard(readableBinding)
|
||||||
notifications.success("Value copied to clipboard")
|
notifications.success("Binding copied to clipboard")
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@
|
||||||
hoverable
|
hoverable
|
||||||
color="var(--spectrum-global-color-gray-600)"
|
color="var(--spectrum-global-color-gray-600)"
|
||||||
hoverColor="var(--spectrum-global-color-gray-900)"
|
hoverColor="var(--spectrum-global-color-gray-900)"
|
||||||
on:click={copyValue}
|
on:click={copyBinding}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue