FIX: hyperlinks did not work in category boxes

This commit is contained in:
Sam
2018-05-17 12:02:24 +10:00
parent f6c35e5abc
commit cc7ecb8a06
3 changed files with 26 additions and 17 deletions
@@ -1,4 +1,5 @@
import computed from 'ember-addons/ember-computed-decorators';
import DiscourseURL from 'discourse/lib/url';
export default Ember.Component.extend({
tagName: "section",
@@ -8,5 +9,14 @@ export default Ember.Component.extend({
anyLogos() {
return this.get("categories").any((c) => { return !Ember.isEmpty(c.get('uploaded_logo.url')); });
return this.get("categories").any(c => !Ember.isEmpty(c.get('uploaded_logo.url')));
},
click(e) {
if (!$(e.target).is('a')) {
const url = $(e.target).closest('.category-box').data("url");
if (url) {
DiscourseURL.routeTo(url);
}
}
}
});