Browse Source

Add username as a title for mentions (#1385)

Add a title attribute on mention links for both notifications
and mentions in statuses.

Related to #1350
closed-social-glitch-2
Matthias Jouan 7 years ago
committed by Eugen
parent
commit
3fd5385e7b
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      app/assets/javascripts/components/components/status_content.jsx
  2. +1
    -1
      app/assets/javascripts/components/features/notifications/components/notification.jsx

+ 1
- 0
app/assets/javascripts/components/components/status_content.jsx View File

@ -36,6 +36,7 @@ const StatusContent = React.createClass({
if (mention) {
link.addEventListener('click', this.onMentionClick.bind(this, mention), false);
link.setAttribute('title', mention.get('acct'));
} 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) {

+ 1
- 1
app/assets/javascripts/components/features/notifications/components/notification.jsx View File

@ -76,7 +76,7 @@ const Notification = React.createClass({
const account = notification.get('account');
const displayName = account.get('display_name').length > 0 ? account.get('display_name') : account.get('username');
const displayNameHTML = { __html: emojify(escapeTextContentForBrowser(displayName)) };
const link = <Permalink className='notification__display-name' style={linkStyle} href={account.get('url')} to={`/accounts/${account.get('id')}`} dangerouslySetInnerHTML={displayNameHTML} />;
const link = <Permalink className='notification__display-name' style={linkStyle} href={account.get('url')} title={account.get('acct')} to={`/accounts/${account.get('id')}`} dangerouslySetInnerHTML={displayNameHTML} />;
switch(notification.get('type')) {
case 'follow':

Loading…
Cancel
Save