Skip to content

Commit

Permalink
use a variable for nodeContext
Browse files Browse the repository at this point in the history
  • Loading branch information
jkppr committed Oct 24, 2023
1 parent 0074652 commit df5023f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions timesketch/frontend-ng/src/components/Explore/UnfurlDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ limitations under the License.
<div style="font-size: medium" class="py-1 px-1">
<span style="font-weight: bold">Selected node context: </span>
<br />
<span ref="nodeContext" style="font-style: italic">{{ nodeContextDefault }}</span>
<span style="font-style: italic" v-html="nodeContext"></span>
</div>
<div ref="graphContainer" :style="{ height: canvasHeight, width: '100%' }">
<v-row no-gutters>
Expand Down Expand Up @@ -94,6 +94,7 @@ export default {
unfurlReady: false,
unfurlData: {},
canvasHeight: '400px',
nodeContext: '',
nodeContextDefault: 'Select a node in the graph below to get more information.',
config: {
style: [
Expand Down Expand Up @@ -156,11 +157,15 @@ export default {
}
},
computed: {
nodeContextValue() {
return this.nodeContext
},
getUnfurlLogo() {
if (this.$vuetify.theme.dark) {
return '/unfurl-logo-dark.png'
} else {
return '/unfurl-logo.png' }
return '/unfurl-logo.png'
}
},
},
methods: {
Expand Down Expand Up @@ -248,7 +253,7 @@ export default {
nodeSelection: function (event) {
this.cy.edges().removeClass('highlight')
event.target.outgoers('edge').addClass('highlight')
this.$refs.nodeContext.innerHTML = event.target.data().context
this.nodeContext = event.target.data().context
? event.target.data().context
: 'No context available for this node.'
this.resizeCanvas()
Expand All @@ -267,7 +272,7 @@ export default {
})
this.cy.on('unselect', 'node', (event) => {
this.cy.elements().removeClass('highlight')
this.$refs.nodeContext.innerHTML = this.nodeContextDefault
this.nodeContext = this.nodeContextDefault
})
},
}
Expand Down

0 comments on commit df5023f

Please sign in to comment.