mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Remove reliance on JS for category box links
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import Component from "@ember/component";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
|
||||
export default Component.extend({
|
||||
tagName: "section",
|
||||
@@ -19,16 +18,5 @@ export default Component.extend({
|
||||
@discourseComputed("categories.[].subcategories")
|
||||
hasSubcategories() {
|
||||
return this.categories.any(c => !isEmpty(c.get("subcategories")));
|
||||
},
|
||||
|
||||
click(e) {
|
||||
if (!$(e.target).is("a")) {
|
||||
const url = $(e.target)
|
||||
.closest(".category-box")
|
||||
.data("url");
|
||||
if (url) {
|
||||
DiscourseURL.routeTo(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<div class="category-details">
|
||||
<div class='category-box-heading'>
|
||||
<a href={{c.url}}>
|
||||
<a class="parent-box-link" href={{c.url}}>
|
||||
<h3>
|
||||
{{#if c.read_restricted}}
|
||||
{{d-icon 'lock'}}
|
||||
|
||||
Reference in New Issue
Block a user