Skip to content

Commit

Permalink
chore: hide tools in narrative mode
Browse files Browse the repository at this point in the history
  • Loading branch information
A-Behairi committed Oct 24, 2023
1 parent c810365 commit e7b97f7
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions app/src/components/IndicatorFiltersPanel.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<eox-itemfilter class="pa-2" >
<eox-itemfilter class="pa-2" ref="itemFilterEl" >
<h4 slot="filterstitle" style="margin-top: 8px">
{{this.appConfig.id === "gtif" ? "Domains" : "Filter"}}
</h4>
Expand Down Expand Up @@ -36,6 +36,9 @@ export default {
...mapGetters('indicators', [
'getIndicators',
]),
...mapState('gtif',[
'toolsToggle'
])
},
created() {
if (this.indicators) {
Expand Down Expand Up @@ -103,7 +106,9 @@ export default {
aggregateResults: 'themes',
enableHighlighting: true,
onSelect: (item) => {
this.setSelectedIndicator(item);
if (this.$store.state.gtif.toolsToggle) {
this.setSelectedIndicator(item);
}
},
},
gtif: {
Expand Down Expand Up @@ -192,6 +197,24 @@ export default {
${flags}
${configs[this.appConfig.id].styleOverride}
`;
this.$nextTick(()=>{
if (this.appConfig.id === 'gtif') {
this.$watch('toolsToggle',
function(inToolsMode,_){
const titleEl = this.$refs.itemFilterEl.shadowRoot.querySelector('slot[name=resultstitle]')
const resultsEl = this.$refs.itemFilterEl.shadowRoot.getElementById('results')
if (inToolsMode) {
titleEl.style.display = ''
resultsEl.style.display = ''
}else{
titleEl.style.display = 'none'
resultsEl.style.display = 'none'
}
},{
immediate:true
})
}
})
});
},
},
Expand Down

0 comments on commit e7b97f7

Please sign in to comment.