mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: keep tag filter value when changing the category dropdown. (#11065)
Previously, while filtering the topics by tag, selecting a category loses the selected tag value.
This commit is contained in:
parent
b2847e3753
commit
2d5bb516a6
@ -3,6 +3,7 @@
|
|||||||
{{category-drop
|
{{category-drop
|
||||||
category=breadcrumb.category
|
category=breadcrumb.category
|
||||||
categories=breadcrumb.options
|
categories=breadcrumb.options
|
||||||
|
tagId=tagId
|
||||||
options=(hash
|
options=(hash
|
||||||
parentCategory=breadcrumb.parentCategory
|
parentCategory=breadcrumb.parentCategory
|
||||||
subCategory=breadcrumb.isSubcategory
|
subCategory=breadcrumb.isSubcategory
|
||||||
|
@ -161,7 +161,14 @@ export default ComboBoxComponent.extend({
|
|||||||
onChange(categoryId) {
|
onChange(categoryId) {
|
||||||
let categoryURL;
|
let categoryURL;
|
||||||
|
|
||||||
if (categoryId === ALL_CATEGORIES_ID) {
|
if (this.tagId && !this.category) {
|
||||||
|
const category = Category.findById(parseInt(categoryId, 10));
|
||||||
|
categoryURL = getURL(
|
||||||
|
`/tags/c/${Category.slugFor(category)}/${
|
||||||
|
category.id
|
||||||
|
}/${this.tagId.toLowerCase()}`
|
||||||
|
);
|
||||||
|
} else if (categoryId === ALL_CATEGORIES_ID) {
|
||||||
categoryURL = this.allCategoriesUrl;
|
categoryURL = this.allCategoriesUrl;
|
||||||
} else if (categoryId === NO_CATEGORIES_ID) {
|
} else if (categoryId === NO_CATEGORIES_ID) {
|
||||||
categoryURL = this.noCategoriesUrl;
|
categoryURL = this.noCategoriesUrl;
|
||||||
|
Loading…
Reference in New Issue
Block a user