mirror of
https://github.com/enso-org/enso.git
synced 2024-12-22 18:01:38 +03:00
Disable clickThrough for get nodes for anything thats datatype is not JS_Object (#10286)
This commit is contained in:
parent
dc7ae17fb0
commit
0fc3755d1b
@ -17,6 +17,10 @@ const config = useVisualizationConfig()
|
||||
|
||||
type ConstructivePattern = (placeholder: Ast.Owned) => Ast.Owned
|
||||
|
||||
const JSON_OBJECT_TYPE = 'Standard.Base.Data.Json.JS_Object'
|
||||
|
||||
const isClickThroughEnabled = config.nodeType === JSON_OBJECT_TYPE
|
||||
|
||||
function projector(parentPattern: ConstructivePattern | undefined) {
|
||||
const style = {
|
||||
spaced: parentPattern !== undefined,
|
||||
@ -53,7 +57,11 @@ function createProjection(path: (string | number)[][]) {
|
||||
<template>
|
||||
<VisualizationContainer :belowToolbar="true">
|
||||
<div class="JSONVisualization">
|
||||
<JsonValueWidget :data="props.data" @createProjection="createProjection" />
|
||||
<JsonValueWidget
|
||||
:data="props.data"
|
||||
:class="{ viewonly: !isClickThroughEnabled }"
|
||||
@createProjection="createProjection"
|
||||
/>
|
||||
</div>
|
||||
</VisualizationContainer>
|
||||
</template>
|
||||
@ -63,4 +71,7 @@ function createProjection(path: (string | number)[][]) {
|
||||
font-family: var(--font-mono);
|
||||
padding: 8px;
|
||||
}
|
||||
.viewonly {
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user