FIX: Topic Entrance wasn't showing up on some suggested topics

This commit is contained in:
Robin Ward 2017-06-28 17:37:43 -04:00
parent ad4694cdcd
commit 25cecd5d25
1 changed files with 12 additions and 3 deletions

View File

@ -39,12 +39,21 @@ export default Ember.Component.extend({
if (!this.site.mobileView) { return; }
let target = $(e.target);
if (target.hasClass('posts-map')) {
if (target.closest('.posts-map').length) {
const topicId = target.closest('tr').attr('data-topic-id');
if (topicId) {
if (target.prop('tagName') !== 'A') {
target = target.find('a');
let targetLinks = target.find('a');
if (targetLinks.length) {
target = targetLinks;
} else {
targetLinks = target.closest('a');
if (targetLinks.length) {
target = targetLinks;
} else {
return false;
}
}
}
const topic = this.get('topics').findBy('id', parseInt(topicId));