mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
DEV: Add new style filterType property to NavItem model
This commit is contained in:
@ -2,6 +2,7 @@ import discourseComputed from "discourse-common/utils/decorators";
|
||||
import { emojiUnescape } from "discourse/lib/text";
|
||||
import Category from "discourse/models/category";
|
||||
import EmberObject from "@ember/object";
|
||||
import { reads } from "@ember/object/computed";
|
||||
import deprecated from "discourse-common/lib/deprecated";
|
||||
import Site from "discourse/models/site";
|
||||
import User from "discourse/models/user";
|
||||
@ -33,8 +34,8 @@ const NavItem = EmberObject.extend({
|
||||
);
|
||||
},
|
||||
|
||||
@discourseComputed("name", "category", "noSubcategories", "tagId")
|
||||
href(filterMode, category, noSubcategories, tagId) {
|
||||
@discourseComputed("filterType", "category", "noSubcategories", "tagId")
|
||||
href(filterType, category, noSubcategories, tagId) {
|
||||
let customHref = null;
|
||||
|
||||
NavItem.customNavItemHrefs.forEach(function(cb) {
|
||||
@ -49,9 +50,11 @@ const NavItem = EmberObject.extend({
|
||||
}
|
||||
|
||||
const context = { category, noSubcategories, tagId };
|
||||
return NavItem.pathFor(filterMode, context);
|
||||
return NavItem.pathFor(filterType, context);
|
||||
},
|
||||
|
||||
filterType: reads("name"),
|
||||
|
||||
@discourseComputed("name", "category", "noSubcategories")
|
||||
filterMode(name, category, noSubcategories) {
|
||||
let mode = "";
|
||||
|
Reference in New Issue
Block a user