1
1
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 ()

This commit is contained in:
marthasharkey 2024-06-18 09:27:20 +01:00 committed by GitHub
parent dc7ae17fb0
commit 0fc3755d1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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>