diff --git a/code/websites/pokedex.online/src/components/gamemaster/JsonViewer.vue b/code/websites/pokedex.online/src/components/gamemaster/JsonViewer.vue index 9443026..ef48d7d 100644 --- a/code/websites/pokedex.online/src/components/gamemaster/JsonViewer.vue +++ b/code/websites/pokedex.online/src/components/gamemaster/JsonViewer.vue @@ -111,6 +111,10 @@ const props = defineProps({ lineHeight: { type: Number, default: 20 + }, + selectionState: { + type: Object, + default: null } }); @@ -120,11 +124,13 @@ const selectedFile = toRef(props, 'selectedFile'); const virtualScroller = ref(null); -const { selectedLines, toggleLineSelection } = useLineSelection( +const internalSelectionState = useLineSelection( displayLines, fileContent, selectedFile ); +const activeSelectionState = computed(() => props.selectionState || internalSelectionState); +const { selectedLines, toggleLineSelection } = activeSelectionState.value; const isCurrentResult = lineNumber => { if (!props.searchResults.length) return false;