]> cat aescling's git repositories - mastodon.git/commitdiff
Add image descriptions to title attribute to view on mouse hover/long-press. (#5137)
authorDaggertooth <dev@monsterpit.net>
Sat, 30 Sep 2017 22:35:49 +0000 (17:35 -0500)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 30 Sep 2017 22:35:49 +0000 (00:35 +0200)
* Add image descriptions to `title` attribute to view on mouse hover/long-press.

* Too many title properties may spoil the broth.

app/javascript/mastodon/components/media_gallery.js

index e7f14a7db5f90db51b891659acd83a72c3ff992a..fb71d8c5ca042945de98b2646b59192da703cfb5 100644 (file)
@@ -135,7 +135,7 @@ class Item extends React.PureComponent {
           onClick={this.handleClick}
           target='_blank'
         >
-          <img src={previewUrl} srcSet={srcSet} sizes={sizes} alt={attachment.get('description')} />
+          <img src={previewUrl} srcSet={srcSet} sizes={sizes} alt={attachment.get('description')} title={attachment.get('description')} />
         </a>
       );
     } else if (attachment.get('type') === 'gifv') {