4,554
edits
No edit summary |
No edit summary |
||
Line 156: | Line 156: | ||
event.stopPropagation(); // Prevent the event from bubbling up | event.stopPropagation(); // Prevent the event from bubbling up | ||
console.log('openModal called with:', cardElement); | console.log('openModal called with:', cardElement); | ||
var isRelatedArticle = $(cardElement). | var isRelatedArticle = $(cardElement).hasClass('related-article'); | ||
console.log('Is this a related article?:', isRelatedArticle); | console.log('Is this a related article?:', isRelatedArticle); | ||
showArticleWrapper.css('display', 'block'); | showArticleWrapper.css('display', 'block'); | ||
var wrapperWidth = showArticleWrapper.outerWidth(true); | var wrapperWidth = showArticleWrapper.outerWidth(true); | ||
console.log('Wrapper width:', wrapperWidth); | console.log('Wrapper width:', wrapperWidth); | ||
Line 363: | Line 363: | ||
} | } | ||
openModal(this, event); // Pass the event object to openModal | openModal(this, event); // Pass the event object to openModal | ||
}); | |||
$('#list, #list-list').on('mousedown', '.related-article', function(event) { | |||
openModal(this, event); // Pass the clicked related article element to the openModal function | |||
}); | }); | ||