Skip to content

Commit

Permalink
Merge pull request #2502 from patzick/bugfix/2435-inverted-filters
Browse files Browse the repository at this point in the history
Bugfix/2435 inverted filters
  • Loading branch information
patzick committed Feb 26, 2019
2 parents aa30ecc + 9feed8d commit 5863faf
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- add cart count config, allows you to display the item count instead of a sum of the item quantities - @pauluse (#2483)
- improved product gallery load view, shows correct image on reload - @patzick (#2481, #2482, #2488, #2501)
- Fix an issue where the index.html template within a theme is ignored - @EnthrallRecords (#2489)
- Inconsistent filters behaviour - clear filters on page load - @patzick (#2435)
- fix price is never below 0 and user can't add 0 or below 0 products to cart @RakowskiPrzemyslaw (#2437)

### Deprecated / Removed
Expand Down
3 changes: 3 additions & 0 deletions core/compatibility/components/blocks/Category/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export default {
return Object.keys(this.activeFilters).length !== 0
}
},
mounted () {
this.resetAllFilters()
},
methods: {
sortById (filters) {
return [...filters].sort((a, b) => { return a.id - b.id })
Expand Down
29 changes: 20 additions & 9 deletions src/themes/default/components/core/blocks/Category/Sidebar.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<template>
<div class="sidebar">
<h4>
{{ $t('Filter') }}
<h4 class="sidebar__header">
<span> {{ $t('Filter') }} </span>
<button
class="no-outline brdr-none py15 px40 bg-cl-mine-shaft :bg-cl-th-secondary ripple h5 cl-white sans-serif"
@click="resetAllFilters"
v-show="hasActiveFilters"
>
{{ $t('Clear') }}
</button>
</h4>
<button
class="no-outline brdr-none py15 px40 bg-cl-mine-shaft :bg-cl-th-secondary ripple h5 cl-white sans-serif"
@click="resetAllFilters"
v-show="hasActiveFilters"
>
{{ $t('Clear') }}
</button>
<div
v-for="(filter, filterIndex) in availableFilters"
:key="filterIndex"
Expand Down Expand Up @@ -99,3 +99,14 @@ export default {
mixins: [Sidebar]
}
</script>

<style lang="scss" scoped>
.sidebar {
&__header {
display: flex;
justify-content: space-between;
align-items: center;
min-height: 47px;
}
}
</style>

0 comments on commit 5863faf

Please sign in to comment.