mirror of
https://github.com/enso-org/enso.git
synced 2025-01-05 15:42:52 +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
|
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) {
|
function projector(parentPattern: ConstructivePattern | undefined) {
|
||||||
const style = {
|
const style = {
|
||||||
spaced: parentPattern !== undefined,
|
spaced: parentPattern !== undefined,
|
||||||
@ -53,7 +57,11 @@ function createProjection(path: (string | number)[][]) {
|
|||||||
<template>
|
<template>
|
||||||
<VisualizationContainer :belowToolbar="true">
|
<VisualizationContainer :belowToolbar="true">
|
||||||
<div class="JSONVisualization">
|
<div class="JSONVisualization">
|
||||||
<JsonValueWidget :data="props.data" @createProjection="createProjection" />
|
<JsonValueWidget
|
||||||
|
:data="props.data"
|
||||||
|
:class="{ viewonly: !isClickThroughEnabled }"
|
||||||
|
@createProjection="createProjection"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</VisualizationContainer>
|
</VisualizationContainer>
|
||||||
</template>
|
</template>
|
||||||
@ -63,4 +71,7 @@ function createProjection(path: (string | number)[][]) {
|
|||||||
font-family: var(--font-mono);
|
font-family: var(--font-mono);
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
}
|
}
|
||||||
|
.viewonly {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user