From 87830f99e7e47f19ce9368cca93b66a8c1c34517 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 5 Feb 2017 15:25:55 +0100 Subject: Fix #552 - Replace image links with image icons in status text in the UI --- app/assets/javascripts/components/components/status_content.jsx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/assets/javascripts/components') diff --git a/app/assets/javascripts/components/components/status_content.jsx b/app/assets/javascripts/components/components/status_content.jsx index 81c104860..9263a76f5 100644 --- a/app/assets/javascripts/components/components/status_content.jsx +++ b/app/assets/javascripts/components/components/status_content.jsx @@ -42,11 +42,14 @@ const StatusContent = React.createClass({ for (var i = 0; i < links.length; ++i) { let link = links[i]; let mention = this.props.status.get('mentions').find(item => link.href === item.get('url')); + let media = this.props.status.get('media_attachments').find(item => link.href === item.get('text_url') || link.href === item.get('remote_url')); if (mention) { link.addEventListener('click', this.onMentionClick.bind(this, mention), false); } else if (link.textContent[0] === '#' || (link.previousSibling && link.previousSibling.textContent && link.previousSibling.textContent[link.previousSibling.textContent.length - 1] === '#')) { link.addEventListener('click', this.onHashtagClick.bind(this, link.text), false); + } else if (media) { + link.innerHTML = ''; } else { link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener'); -- cgit