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 04bc75b521
commit 3479298a71

View File

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