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