Skip to content

Commit

Permalink
conditional KModal / div display for categories selection modal & cle…
Browse files Browse the repository at this point in the history
…an up
  • Loading branch information
nucleogenesis committed Nov 11, 2024
1 parent b1c4632 commit 0429eac
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

<script>
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import useKResponsiveWindow from 'kolibri-design-system/lib/composables/useKResponsiveWindow';
import CategorySearchOptions from './CategorySearchOptions';
Expand All @@ -20,7 +19,6 @@
components: {
CategorySearchOptions,
},
mixins: [commonCoreStrings],
setup() {
const { windowIsLarge } = useKResponsiveWindow();
return {
Expand All @@ -44,12 +42,6 @@
this.$refs.searchOptions.$el.querySelector('.filter-list-title > h2 > a').focus();
},
},
$trs: {
title: {
message: 'Choose a category',
context: 'Title of the category selection window',
},
},
};
</script>
28 changes: 21 additions & 7 deletions packages/kolibri-common/components/SearchFiltersPanel/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,24 @@
</div>
</div>
</div>
<CategorySearchModal
v-if="currentCategory"
ref="searchModal"
:class="windowIsLarge ? '' : 'drawer-panel'"
:selectedCategory="currentCategory"
<!-- When accordion mode is NOT activated, show as KModal, otherwise, just a div -->
<component
:is="accordion ? 'div' : 'KModal'"
v-if="windowIsLarge && currentCategory"
appendToOverlay
:title="$tr('chooseACategory')"
:cancelText="coreString('closeAction')"
size="large"
@cancel="currentCategory = null"
@input="selectCategory"
/>
>
<CategorySearchModal
v-if="currentCategory"
ref="searchModal"
:class="windowIsLarge ? '' : 'drawer-panel'"
:selectedCategory="currentCategory"
@input="selectCategory"
/>
</component>
</section>

</template>
Expand Down Expand Up @@ -404,6 +414,10 @@
message: 'Categories',
context: 'Section header label in the Library page sidebar.',
},
chooseACategory: {
message: 'Choose a category',
context: 'Title of the category selection window',
},
},
};
Expand Down

0 comments on commit 0429eac

Please sign in to comment.